Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php trivia: =>

7 views
Skip to first unread message

Justin Koivisto

unread,
Sep 26, 2005, 8:30:20 PM9/26/05
to
Does anyone know what the name of the => operator in PHP is? It is
something that is nearly impossible to search for, and I am not sure if
it even has a name. I know that there has been a couple php-dev people
in here before, so maybe someone kind throw me a bone... ;)

--
Justin Koivisto, ZCE - jus...@koivi.com
http://koivi.com

boclair

unread,
Sep 26, 2005, 8:47:43 PM9/26/05
to
Justin Koivisto wrote:
> Does anyone know what the name of the => operator in PHP is? It is
> something that is nearly impossible to search for, and I am not sure if
> it even has a name. I know that there has been a couple php-dev people
> in here before, so maybe someone kind throw me a bone... ;)
>

I know it as "assignment operator" but probably incorrectly.

Louise

Justin Koivisto

unread,
Sep 26, 2005, 10:51:34 PM9/26/05
to
boclair wrote:

The assignment operator would the just the = as in:

$a = 5;
"Variable a is assigned the integer value of five"

Almost everywhere I've seen it discussed it is simply referenced as:
"key => value" and is always typed out.

However, I guess it is sort of an assignment operator... Great now there
are 2 of them! ;)

It's not a big deal, just one of those curiosity things that starts to
annoy you late at night. That and I figured that it was about time I
asked a question here anyway...

Chung Leong

unread,
Sep 26, 2005, 11:41:10 PM9/26/05
to
Good question. In the source code it's known as the double arrow. Not a
correct use of the term though.

Geoff Berrow

unread,
Sep 27, 2005, 2:10:14 AM9/27/05
to
I noticed that Message-ID: <g7adnSZjsrQ...@onvoy.com> from
Justin Koivisto contained the following:

>Does anyone know what the name of the => operator in PHP is? It is
>something that is nearly impossible to search for, and I am not sure if
>it even has a name. I know that there has been a couple php-dev people
>in here before, so maybe someone kind throw me a bone... ;)

I couldn't find out either so I decided to name it myself. I call it an
'andits' foreach ($key andits $value){... Geddit?

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

Kirsten

unread,
Sep 27, 2005, 2:55:43 AM9/27/05
to
Justin Koivisto schrieb:

> Does anyone know what the name of the => operator in PHP is? It is
> something that is nearly impossible to search for, and I am not sure if
> it even has a name.
I never seen a name for it.
...mmmmmh, but if there is no name, i think we should find one for it.

-Kirsten

Geoff Berrow

unread,
Sep 27, 2005, 2:57:51 AM9/27/05
to
I noticed that Message-ID:
<1127804150.fa5fba4a665ee16af6fb52b194e3986e@teranews> from Kirsten
contained the following:

>I never seen a name for it.
>...mmmmmh, but if there is no name, i think we should find one for it.

See my other post. I'm trying to popularise 'andits'

Could be my major contribution to the open source community :-)

Kirsten

unread,
Sep 27, 2005, 5:01:55 AM9/27/05
to
Geoff Berrow schrieb:

> See my other post. I'm trying to popularise 'andits'
>
> Could be my major contribution to the open source community :-)
>
Yes thats it, it's all in one word, let's send it to ZEND so they could
use it in their next PHP documentaion. :-)

-Kirsten

Justin Koivisto

unread,
Sep 27, 2005, 8:24:18 AM9/27/05
to
Geoff Berrow wrote:
> I noticed that Message-ID: <g7adnSZjsrQ...@onvoy.com> from
> Justin Koivisto contained the following:
>
>>Does anyone know what the name of the => operator in PHP is? It is
>>something that is nearly impossible to search for, and I am not sure if
>>it even has a name. I know that there has been a couple php-dev people
>>in here before, so maybe someone kind throw me a bone... ;)
>
> I couldn't find out either so I decided to name it myself. I call it an
> 'andits' foreach ($key andits $value){... Geddit?

Now that's funny!

I've been calling the "indirect assignment operator" in the class notes
that I've been preparing, but wanted to see if there was an official name...

I think for now I will stick with what I have in the notes. I think that
naming an assignment operator in a way that could possibly be confused
with a logical operator would just be too confusing for newbies. ;)

ZeldorBlat

unread,
Sep 27, 2005, 10:16:42 AM9/27/05
to
>I never seen a name for it.
>...mmmmmh, but if there is no name, i think we should find one for it.

What's wrong with "equal to or greater than?"

Justin Koivisto

unread,
Sep 27, 2005, 10:52:17 AM9/27/05
to
ZeldorBlat wrote:

um... ya, that would be a comparison operator, and that is not what this
is...

Justin Koivisto

unread,
Sep 27, 2005, 11:11:32 AM9/27/05
to
Justin Koivisto wrote:

> Does anyone know what the name of the => operator in PHP is? It is
> something that is nearly impossible to search for, and I am not sure if
> it even has a name. I know that there has been a couple php-dev people
> in here before, so maybe someone kind throw me a bone... ;)
>

OK, I've decided to call it "double arrow" as in the source code... Now
the php docs just need to be updated to give it the name so that is
searchable. Thanks to Chung and Chris Shiflett (off-list) on this one.

Geoff Berrow

unread,
Sep 27, 2005, 11:54:35 AM9/27/05
to
I noticed that Message-ID: <2MGdnTpp5aF...@onvoy.com> from

Justin Koivisto contained the following:

>> I couldn't find out either so I decided to name it myself. I call it an


>> 'andits' foreach ($key andits $value){... Geddit?
>
>Now that's funny!
>
>I've been calling the "indirect assignment operator" in the class notes
>that I've been preparing, but wanted to see if there was an official name...
>
>I think for now I will stick with what I have in the notes. I think that
>naming an assignment operator in a way that could possibly be confused
>with a logical operator would just be too confusing for newbies. ;)

Well I wouldn't stress the 'and' part but I see what you mean. However
I teach a beginners class and my students don't get confused (well they
get pretty confused with logical operators, but that's another story.

Double arrow? Nah, that does nothing. I think the best names at least
imply some meaning. I think I'll stick with 'andits'. :-)

Justin Koivisto

unread,
Sep 27, 2005, 12:20:38 PM9/27/05
to
Geoff Berrow wrote:

> I noticed that Message-ID: <2MGdnTpp5aF...@onvoy.com> from
> Justin Koivisto contained the following:
>
>
>>>I couldn't find out either so I decided to name it myself. I call it an
>>>'andits' foreach ($key andits $value){... Geddit?
>>
>>Now that's funny!
>>
>>I've been calling the "indirect assignment operator" in the class notes
>>that I've been preparing, but wanted to see if there was an official name...
>>
>>I think for now I will stick with what I have in the notes. I think that
>>naming an assignment operator in a way that could possibly be confused
>>with a logical operator would just be too confusing for newbies. ;)
>
>
> Well I wouldn't stress the 'and' part but I see what you mean. However
> I teach a beginners class and my students don't get confused (well they
> get pretty confused with logical operators, but that's another story.
>
> Double arrow? Nah, that does nothing. I think the best names at least
> imply some meaning. I think I'll stick with 'andits'. :-)

Don't get me wrong, I like it, but IME catchy names like this don't
stick. Programmers seem to always fall back on the boring, simple ones. ;)

Geoff Berrow

unread,
Sep 27, 2005, 12:47:14 PM9/27/05
to
I noticed that Message-ID: <BY-dncGz7qb...@onvoy.com> from

Justin Koivisto contained the following:

>> Double arrow? Nah, that does nothing. I think the best names at least


>> imply some meaning. I think I'll stick with 'andits'. :-)
>
>Don't get me wrong, I like it, but IME catchy names like this don't
>stick. Programmers seem to always fall back on the boring, simple ones. ;)

Well there's pling...

Andy Hassall

unread,
Sep 27, 2005, 3:38:42 PM9/27/05
to
On Mon, 26 Sep 2005 19:30:20 -0500, Justin Koivisto <jus...@koivi.com> wrote:

>Does anyone know what the name of the => operator in PHP is? It is
>something that is nearly impossible to search for, and I am not sure if
>it even has a name. I know that there has been a couple php-dev people
>in here before, so maybe someone kind throw me a bone... ;)

In the parser's scanner it's T_DOUBLE_ARROW, so it's a double arrow.

andyh@server:/usr/src/php-5.1.0RC1/Zend$ grep -2 '=>' zend_language_scanner.l
}

<ST_IN_SCRIPTING>"=>" {
return T_DOUBLE_ARROW;
}
--
Andy Hassall :: an...@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

Larry Jaques

unread,
Sep 28, 2005, 4:23:31 PM9/28/05
to
On Tue, 27 Sep 2005 08:55:43 +0200, with neither quill nor qualm,
Kirsten <K.Sc...@feuerwehr-meerbusch.de> quickly quoth:

Maybe that's why I'm having trouble wrapping my mind around classes.
I don't know the operator sign's name. ;)

How about "egrets" from Equal GREater-Than Sign ?

--
"Simplicity of life, even the barest, is not misery but
the very foundation of refinement." --William Morris
-----------------------------------
www.diversify.com Comprehensive Website Development

Colin Fine

unread,
Sep 28, 2005, 7:23:07 PM9/28/05
to
Justin Koivisto wrote:
> Geoff Berrow wrote:
>
>>I noticed that Message-ID: <g7adnSZjsrQ...@onvoy.com> from
>>Justin Koivisto contained the following:
>>
>>
>>>Does anyone know what the name of the => operator in PHP is? It is
>>>something that is nearly impossible to search for, and I am not sure if
>>>it even has a name. I know that there has been a couple php-dev people
>>>in here before, so maybe someone kind throw me a bone... ;)
>>
>>I couldn't find out either so I decided to name it myself. I call it an
>>'andits' foreach ($key andits $value){... Geddit?
>
>
> Now that's funny!
>
> I've been calling the "indirect assignment operator" in the class notes
> that I've been preparing, but wanted to see if there was an official name...
>
Now this is like the Holy Roman Empire which was neither Holy nor Roman,
nor (in its later days) an Empire.

Whatever => is, it is not an operator (it's a bit of syntax like a comma
), does not denote assignment, and has not much to do with indirection.

Sklar's book (Learning PHP5) glosses it as 'key/value pair separator',
but only in the index as far as I can tell.

I rather like 'andits'

Colin

Kirsten

unread,
Sep 29, 2005, 7:15:50 AM9/29/05
to
Larry Jaques schrieb:

>
> Maybe that's why I'm having trouble wrapping my mind around classes.
> I don't know the operator sign's name. ;)
>
> How about "egrets" from Equal GREater-Than Sign ?
>
Thats nice, too.
Therefor we have now two suggestions:

-"andits"
-"egrets"
Anyone an other suggestion?

-Kirsten

P.S.: May be the reason why many people have trouble understanding
classes ;)

none743873297498237

unread,
Sep 29, 2005, 9:38:43 AM9/29/05
to
foreach($a as $k "y su" $v ){

}

as an english pun, it sounds acceptable, however, it would confuse
(even more) the non-hacker & the non-english speaking comunity outside
the US
, i for one, speak spanish, and the joke is not obvious at first
glance, so:

es => ' y su '
en => "and it's"

seriously, it doesnt really make that much sense,
and remember, u must take internationalization into consideration when
u name things like that, so u dont go the ms way:
i.e.
windows vista:
vista, in spanish means "view", (but you probably knew that)
however, in lativian, its another story
(http://www.activewin.com/awin/comments.asp?HeadlineIndex=30777)

quote:

In Latvian this one will be great : Windows Chicken (that's for
Latvian vista)

:end quote

im not fluent in lativian, nor i know where it is spoken, (europe?),
but i get this feeling that in the lativian speaking comunity, there is
going to be a lot of ppl migrating to linux in late 2006......


so, my suggestion:

=> (check man pages for perl =>, and just copy paste)

Justin Koivisto

unread,
Sep 29, 2005, 10:08:42 AM9/29/05
to
Larry Jaques wrote:

> On Tue, 27 Sep 2005 08:55:43 +0200, with neither quill nor qualm,
> Kirsten <K.Sc...@feuerwehr-meerbusch.de> quickly quoth:
>
>
>>Justin Koivisto schrieb:
>>
>>>Does anyone know what the name of the => operator in PHP is? It is
>>>something that is nearly impossible to search for, and I am not sure if
>>>it even has a name.
>>
>>I never seen a name for it.
>>...mmmmmh, but if there is no name, i think we should find one for it.
>
>
> Maybe that's why I'm having trouble wrapping my mind around classes.
> I don't know the operator sign's name. ;)

=> is an array operator... The indirection operator (->) is used for
classes...

> How about "egrets" from Equal GREater-Than Sign ?

Sounds like a bird to me... ;) Also you may not "regret" using it...

Adam i Agnieszka Gasiorowski FNORD

unread,
Oct 1, 2005, 4:52:47 PM10/1/05
to
On 2005-09-27 06:10:14 +0000, Geoff Berrow <blth...@ckdog.co.uk> said:

> I noticed that Message-ID: <g7adnSZjsrQ...@onvoy.com> from
> Justin Koivisto contained the following:
>
>> Does anyone know what the name of the => operator in PHP is? It is
>> something that is nearly impossible to search for, and I am not sure if
>> it even has a name. I know that there has been a couple php-dev people
>> in here before, so maybe someone kind throw me a bone... ;)
>
> I couldn't find out either so I decided to name it myself. I call it an
> 'andits' foreach ($key andits $value){... Geddit?


How ab{oo}t simply calling it "implication". $key IMPLIES $value.
It even looks like mathematic symbol for implication...

-- 
Seks, seksić, seksolatki...<uri: news:pl.soc.seks.moderowana >
Close to the middle of the network. We're looking for a center. 
What if it turns out to be hollow? We could be what is broken...
https://hyperreal.info | https://kanaba.info |=> "Szanuj Zieleń!"


0 new messages