ID: 32578 User updated by: theteofscuba at hotmail dot com Reported By: theteofscuba at hotmail dot com Status: Bogus -Bug Type: Scripting Engine problem +Bug Type: *General Issues Operating System: XP PHP Version: 5CVS-2005-04-05 (dev) New Comment:
aaaa Previous Comments: ------------------------------------------------------------------------ [2005-04-05 01:27:49] theteofscuba at hotmail dot com this was just a silly mistake. I failed to see that the class object was not defined at the time test3.php executes ------------------------------------------------------------------------ [2005-04-05 01:25:48] theteofscuba at hotmail dot com Description: ------------ see title. i've encountered this problem where the latest snapshot build will not execute methods of global objects. Reproduce code: --------------- file test1.php: <?php global $phpTest; require_once("test2.php"); $phpTest = new PHPTEST(); ?> file test2.php: <?php global $phpTest; class PHPTEST { public $var; function DoSomething() { echo "hi it worked"; } } require_once("test3.php"); ?> file test3.php: <?php global $phpTest; $phpTest->var = "we can set variables just fine"; $phpTest->DoSomething(); // ka-boom ?> Expected result: ---------------- . Actual result: -------------- Fatal error: Call to undefined method stdClass::DoSomething() in C:\php\test3.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32578&edit=1