|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-04-06 14:06 UTC] nikic@php.net
[2012-04-07 15:03 UTC] laruence@php.net
[2012-04-10 10:57 UTC] bjori@php.net
-Status: Open
+Status: Not a bug
[2012-04-10 10:57 UTC] bjori@php.net
[2012-04-11 19:30 UTC] valerio dot bozzolan at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 20:00:01 2025 UTC |
Description: ------------ I already know that nobody in the world will give me an answer, because in a clean file this code works but in the queue of another file it does not work, even if the code of the queue of the second file (which does not work) is exactly identical to what I ran in the first clean file. Var "$a", in the function of my first file, is normal out of the function, and normal in the function. Same code in the queue of my second file give me a different result: "$a" is normal out of the funcion, but in the function IS NULL! (Excuse my English) Test script: --------------- unset($a); $a = "PIPPO"; function foo() { global $a; echo "In function: "; var_dump($a); } echo "Out function: "; var_dump($a); echo "<br />"; foo(); Expected result: ---------------- First clean file result: Out function: string(5) "PIPPO" In function: string(5) "PIPPO" Second file result: Out function: string(5) "PIPPO" In function: string(5) "PIPPO" Actual result: -------------- First clean file result: Out function: string(5) "PIPPO" In function: string(5) "PIPPO" Second file result (inexplicable): Out function: string(5) "PIPPO" In function: NULL