|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-18 16:47 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 16:00:02 2025 UTC |
Description: ------------ Within a function a reference to another variable cannot be assigned to its to a global variable. I also proved this example in php 4.3.3 Sorry by my bad english In spanish: Dentro de una funci?n no se le puede asignar a una variable global una referencia a otra variable (tambi?n global). He probado este ejemplo en php 4.3.3 y php 4.3.4 Reproduce code: --------------- <?php $a = 'a'; $b = 'b'; function f() { global $a, $b; $b = &$a; // Fails } f(); echo $b; $b = &$a; // Works echo $b; ?> Expected result: ---------------- aa Actual result: -------------- ba