note 61793 added to function.array-splice
| From: | Paul at osu1 dot php dot net | Date: | Sun, 12 Feb 2006 06:06:22 +0000 |
| Subject: | note 61793 added to function.array-splice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103541@lists.php.net to get a copy of this message | ||
In PHP 4.3.10, at least, it seems that elements that are inserted as part of the replacement array
are inserted BY REFERENCE (that is, as though with the =& rather than = assignment operation).
So if your replacement array contains elements that references to variables that you can also access
via other variable name, then this will be true of the elements in the final array too.
In particular, this means that it is safe to use array_splice() on arrays of objects, as you
won't be creating copies of the objects (as it is so easy to do in PHP 4).
----
Server IP: 64.71.164.2
Probable Submitter: 66.215.80.17
----
Manual Page -- http://www.php.net/manual/en/function.array-splice.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61793
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61793&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61793&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61793&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61793&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61793&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61793&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61793&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61793&report=yes
Search -- http://master.php.net/manage/user-notes.php