note 114047 added to language.references.spot
| From: | lutondatta at gmail dot com | Date: | Mon, 06 Jan 2014 15:12:32 +0000 |
| Subject: | note 114047 added to language.references.spot | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198128@lists.php.net to get a copy of this message | ||
This is very useful in passing large arrays. If you do not pass the array by reference, you are
creating another copy of the array in memory.
<?php
//Part 1
$x = 40;
$y = $x;
$z =& $x;
echo '$x is ' . $x . '<br />'; //Show 40
echo '$y is ' . $y . '<br />'; //Show 40
echo '$z is ' . $z . '<br />'; //Show 40
//Part 2
$x = 50;
echo '$x is ' . $x . '<br />'; //Show 50
echo '$y is ' . $y . '<br />'; //Show 40
echo '$z is ' . $z . '<br />'; //Show 50
?>
In part 2 value of $z will changes according to $x.
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/language.references.spot.php
Edit -- https://master.php.net/note/edit/114047
Del: integrated -- https://master.php.net/note/delete/114047/integrated
Del: useless -- https://master.php.net/note/delete/114047/useless
Del: bad code -- https://master.php.net/note/delete/114047/bad+code
Del: spam -- https://master.php.net/note/delete/114047/spam
Del: non-english -- https://master.php.net/note/delete/114047/non-english
Del: in docs -- https://master.php.net/note/delete/114047/in+docs
Del: other reasons-- https://master.php.net/note/delete/114047
Reject -- https://master.php.net/note/reject/114047
Search -- https://master.php.net/manage/user-notes.php