|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-21 13:01 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 17:00:01 2025 UTC |
Hello, Using references from and to global vars inside a function doesnt seem to work. Try this out: ---->8----->8----->8----->8- <? function SomeFunction() { global $a, $b, $c; $d = array(1, 2, 3); $a = $d; $b = &$a; $c = &$a; } SomeFunction(); ?><pre>a:<br><?print_r($a)?></pre><hr><? ?><pre>b:<br><?print_r($b)?></pre><hr><? ?><pre>c:<br><?print_r($c)?></pre><hr><? // end ?> ---->8----->8----->8----->8- Logically, $b and $c should be references to $a, but they seem to be empty vars! Thanks, -- vedad