|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-12-05 06:33 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jun 28 10:00:01 2026 UTC |
It concerns variables passed by reference... and the unset() function. # Let's define a very simple function that converts an array to a string : function foo(&$a) { $an_array = array("abcdef"); unset($a); for ($i=0; $i<sizeof($an_array); $i++) $a = $a . $an_array[$i]; } # and call it : foo($my_var); # $my_var is NOT EQUAL TO "abcdef" !!!!! However it works fine when we don't try to unset the $a variable. (replacing the line with $a = "").