# operators

- Thread: https://externals.io/message/57569
- Original archive: https://news-web.php.net/php.internals/57569
- Started by Adi Nita on 2012-01-30T12:34:26+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #57569 — Adi Nita — 2012-01-30T12:34:26+00:00

URL: https://externals.io/message/57569#57569

Hello,

Does anyone know what are the official names for the "->" and "=>"
operators? They don't seem to be included in the PHP documentation,
although I would have expected them to reside in the Operators section of
the manual.

Also, the "\" operator used for declaring sub-namespaces is never mentioned
as a proper operator in the PHP manual, let alone have a specific name.

Thank you,
Adrian

---

## #57570 — Ivan Enderlin @ Hoa — 2012-01-30T12:36:28+00:00

URL: https://externals.io/message/57569#57570 · In reply to: #57569

> Hello,
Hello Adi,

>
> Does anyone know what are the official names for the "->" and "=>"
> operators? They don't seem to be included in the PHP documentation,
> although I would have expected them to reside in the Operators section of
> the manual.
>
> Also, the "\" operator used for declaring sub-namespaces is never mentioned
> as a proper operator in the PHP manual, let alone have a specific name.
You should take a look at <http://php.net/tokens>.

Best regards.

-- 
Ivan Enderlin
Developer of Hoa
http://hoa.42/ or http://hoa-project.net/

PhD. student at LIFC/DISC (Vesontio) and INRIA (Cassis)
http://lifc.univ-fcomte.fr/ and http://www.inria.fr/

Member of HTML and WebApps Working Group of W3C
http://w3.org/

---

## #57571 — Ryan McCue — 2012-01-30T12:37:10+00:00

URL: https://externals.io/message/57569#57571 · In reply to: #57569

Adi Nita wrote:
> Does anyone know what are the official names for the "->" and "=>"
> operators? They don't seem to be included in the PHP documentation,
> although I would have expected them to reside in the Operators section of
> the manual.

The tokens are `T_OBJECT_OPERATOR` and `T_DOUBLE_ARROW` respectively, if
that helps: http://www.php.net/manual/en/tokens.php

The namespace operator is T_NS_SEPARATOR.

Hope that helps,
-- 
Ryan McCue
<http://ryanmccue.info/

---

## #57581 — Stas Malyshev — 2012-01-30T18:55:16+00:00

URL: https://externals.io/message/57569#57581 · In reply to: #57569

Hi!

> Does anyone know what are the official names for the "->" and "=>"
> operators? They don't seem to be included in the PHP documentation,
> although I would have expected them to reside in the Operators section of
> the manual.

=> is not exactly operator, it's part of the array operator syntax (e.g. 
array($foo => $bar) produces array from two vars, => by itself is not 
used). -> is usually called an arrow operator.

> Also, the "\" operator used for declaring sub-namespaces is never mentioned
> as a proper operator in the PHP manual, let alone have a specific name.

\ is not an operator either, it's a namespace separator.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
