|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-20 12:28 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 31 07:00:01 2025 UTC |
Description: ------------ If script links from __autoload(), global variables, defined in it, are not visible in the calling environment. In the simple example below I executed 'autoload.php'. Reproduce code: --------------- file 'foo.php': <? $GLOBAL_VAR = 'GLOBAL_VAR'; class foo {} ?> file 'autoload.php': <? function __autoload ($name) { require_once 'foo.php'; } $foo = new foo(); echo $GLOBAL_VAR; ?> Expected result: ---------------- GLOBAL_VAR Actual result: -------------- Notice: Undefined variable: GLOBAL_VAR in /usr/local/www/data-dist/ils/admin/test/autoload.php on line 7