|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-06 17:47 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 18:00:01 2025 UTC |
Description: ------------ The script should output '1', but it outputs '0'. Looks like the assignment is made locally. But if I replace '$a =& $b' with '$GLOBALS['a'] =& $b' the script will output '1' (right behaviour) Reproduce code: --------------- $b=1; $a=0; function f() { global $a,$b; $a =& $b; } f(); echo $a; Expected result: ---------------- 1 Actual result: -------------- 0