|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-07-20 00:21 UTC] googleguy@php.net
[2012-11-12 09:15 UTC] aharvey@php.net
-Status: Open
+Status: No Feedback
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
Description: ------------ There probably should be an explicit reference to this: "While not being strictly an assignment by reference, expressions created with the language construct array() can also behave as such by prefixing & to the array element to add. The page also explains your why your first code behaves like it does: Note, however, that references inside arrays are potentially dangerous. Doing a normal (not by reference) assignment with a reference on the right side does not turn the left side into a reference, but references inside arrays are preserved in these normal assignments. This also applies to function calls where the array is passed by value." (taken from http://www.php.net/manual/en/language.references.whatdo.php) at the documentation page for 'array': http://php.net/manual/en/language.types.array.php [coming from http://stackoverflow.com/questions/6072444/php-array-copy-semantics-what-it-does-when-members-are-references-and-where-is/]