#32578 [Opn->Bgs]: inclusion bug unable to access global object methods

From: Date: Mon, 04 Apr 2005 23:27:50 +0000
Subject: #32578 [Opn->Bgs]: inclusion bug unable to access global object methods
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77380@lists.php.net to get a copy of this message
ID: 32578 User updated by: theteofscuba at hotmail dot com Reported By: theteofscuba at hotmail dot com -Status: Open +Status: Bogus Bug Type: Zend Engine 2 problem Operating System: XP PHP Version: 5CVS-2005-04-05 (dev) New Comment: this was just a silly mistake. I failed to see that the class object was not defined at the time test3.php executes Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#77380) next »