Doc #52793 [Com]: Output of example code at documention is not as described

From: Date: Wed, 08 Sep 2010 08:43:29 +0000
Subject: Doc #52793 [Com]: Output of example code at documention is not as described
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4993@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52793&edit=1 ID: 52793 Comment by: jurciks66 at inbox dot lv Reported by: jurciks66 at inbox dot lv Summary: Output of example code at documention is not as described Status: Bogus Type: Documentation Problem Package: Documentation problem Operating System: Linux PHP Version: Irrelevant Block user comment: N New Comment: well, sorry about wrong problem description. my test file was parsed by another file, so, actual test script would look like this - <?php function test2() { function test() { $foo = "local variable"; echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n"; echo '$foo in current scope: ' . $foo . "\n"; } $foo = "Example content"; test(); } test2(); ?> So I`m still wondering why my output is - $foo in global scope: $foo in current scope: local variable Previous Comments: ------------------------------------------------------------------------ [2010-09-07 16:26:28] rquadling@php.net [2010/09/07 15:23:31] [Z:\] [\\richardquadling\scratch$ ] >php <?php function test() { $foo = "local variable"; echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n"; echo '$foo in current scope: ' . $foo . "\n"; } $foo = "Example content"; test(); ?> ^Z $foo in global scope: Example content $foo in current scope: local variable Code and example output agree. ------------------------------------------------------------------------ [2010-09-07 16:22:57] jurciks66 at inbox dot lv Description: ------------ Copy and run code from manual about $GLOBALS (http://php.net/manual/en/reserved.variables.globals.php) Actual output is: $foo in global scope: $foo in current scope: local variable Expected result: ---------------- I`m expecting to see the same output as seen on documentation page ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52793&edit=1

« previous php.doc.bugs (#4993) next »