note 39500 added to language.references.whatdo

From: Date: Fri, 30 Jan 2004 16:03:35 +0000
Subject: note 39500 added to language.references.whatdo
Groups: php.notes 
Request: Send a blank email to php-notes+get-64444@lists.php.net to get a copy of this message
I have one warning (spent 3 hours on it) - sample piece of code: function a() { global $glob_var; $local_var = array(); $glob_var = &$localvar; $local_var[1] = 2; $local_var[2] = 3; print_r ($glob_var); } print_r( $glob_var); // no output - empty var a(); // outputs Array ( [1]=>2 [2]=>3 ) print_r( $glob_var); // !!! no output - empty var ($local_var has been discarded) !!! My code was a bit more complex and I needed this construct only for better code reading. I dont know how to make some "temporary reference holder", so finally I had to write everywhere $glob_var instead of $local_var. Stepan Liska. ---- Manual Page -- http://www.php.net/manual/en/language.references.whatdo.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39500 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39500&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39500&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64444) next »