When writing the syntax for an associative array in PHP we do the following
$a = array('foo' => 'bar');
I am curious of the relationship of the => syntax, or possibly operator. Does this relate to some kind of reference used in the hash table in ZE, or some kind of subsequent right shift or reference used in C? I guess I am just wondering the true underlying purpose of this syntax, how it relates to ZE and/or php extensions used to handle arrays, how it possibly relates to the written function in C before compiled, or If I just have no idea what I am talking about 🙂
The
=>symbol a.k.a.T_DOUBLE_ARROWis just a parser token likeclass,||or::.See: The list of php parser tokensIt’s nothing special apart from that fact that
"it looks like an arrow"and it is used for"array stuff".Of course the exact usage is more complicated than that but
"array stuff"is the short inaccurate description that should do it.It’s used to represent
key=> (points to)value