|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-02 20:51 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 06:00:01 2025 UTC |
Description: ------------ 'global' keyword in a function does not work as expected when an file is included from within a function scope Reproduce code: --------------- file b1.php <? $a = '1'; doInclude(); function doInclude() { require('b2.php'); } ?> file b2.php <? $b = '2'; testGlobalScope(); function testGlobalScope() { global $a,$b; print("$a\n$b\n"); } ?> Expected result: ---------------- 1 2 Actual result: -------------- 1