note 91637 added to language.operators.assignment
| From: | Kiam at osu1 dot php dot net | Date: | Sat, 20 Jun 2009 18:48:15 +0000 |
| Subject: | note 91637 added to language.operators.assignment | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157182@lists.php.net to get a copy of this message | ||
There is not an array-append operator; the reported code must be read as
<?php
$array[] = 'assignment test';
?>
It's simply a special case of array index assignment with the difference that, without to
explicitly set an index, PHP will use the last index used and increase it by one.
<?php
$array[1] = 'test';
$array[] = 'another test'; // $array[2]
$array[] = 'try it again; // $array[3]
?>
----
Server IP: 64.71.164.2
Probable Submitter: 24.45.200.143
----
Manual Page -- http://www.php.net/manual/en/language.operators.assignment.php
Edit -- https://master.php.net/note/edit/91637
Del: integrated -- https://master.php.net/note/delete/91637/integrated
Del: useless -- https://master.php.net/note/delete/91637/useless
Del: bad code -- https://master.php.net/note/delete/91637/bad+code
Del: spam -- https://master.php.net/note/delete/91637/spam
Del: non-english -- https://master.php.net/note/delete/91637/non-english
Del: in docs -- https://master.php.net/note/delete/91637/in+docs
Del: other reasons-- https://master.php.net/note/delete/91637
Reject -- https://master.php.net/note/reject/91637
Search -- https://master.php.net/manage/user-notes.php