note 28383 added to language.operators
| From: | jlsalinas at gmx dot SPAMSUCKS dot net | Date: | Sat, 11 Jan 2003 04:11:05 +0000 |
| Subject: | note 28383 added to language.operators | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41988@lists.php.net to get a copy of this message | ||
About Rick's comment on 16-Nov-2002:
=> cannot be an operator, for it would be impossible to specify keys when building arrays.
Supposing that => is an operator, bluiding $arr this way:
$arr = array ('key1' => 'value1', 'key2' => 'value2');
would be exactly the same as:
$arr = array();
$arr[] = 'key1' => 'value1';
$arr[] = 'key2' => 'value2';
and print_r($arr) would yield something like:
array (
[0] => whatever ['key1' => 'value1'] yields,
[1] => whatever ['key2' => 'value2'] yields,
);
That's because being => an operator, "op1 => op2" is an expression and
therefore it yields a value.
--
http://www.php.net/manual/en/language.operators.php
http://master.php.net/manage/user-notes.php?action=edit+28383
http://master.php.net/manage/user-notes.php?action=delete+28383
http://master.php.net/manage/user-notes.php?action=reject+28383