|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-04-02 08:06 UTC] Robin at RHarmsen dot nl
Description: ------------ When I turn on zend Engine1 Compatibility mode my code stops working (It worked perfect on PHP4 and PHP5 withoud the compatibility mode) PHP.ini diffreances: zend.ze1_compatibility_mode = On (off when error doesn't occure) allow_call_time_pass_reference = Off error_reporting = E_ALL register_long_arrays = Off register_argc_argv = Off extension=php_mysql.dll configure line (according to phpinfo()) Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared" I think it is realy strange that an error occures when the mode is activated. though it works on PHP4 and PHP5 withoud the mode activated. It looks like $db in the Menu class is'nt set Reproduce code: --------------- I got the source files located here to reproduce the bug http://www.rharmsen.nl/bugfiles/main.phps http://www.rharmsen.nl/bugfiles/clsDB.phps http://www.rharmsen.nl/bugfiles/clsMenu.phps Expected result: ---------------- I expected that the menu was displayed Actual result: -------------- What I got was: Fatal error: Call to a member function query() on a non-object in clsMenu.php on line 36 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 22:00:01 2025 UTC |
I made a version withoud a DB... It seems that when I set a property of a class in the constructor it suddenly disappears with this code I get the following error: Fatal error: Call to a member function query() on a non-object in bugcode.php on line 24 <?php class A { var $queryCount; function A() { $this->queryCount = 0; } function query() { $this->queryCount = $this->queryCount + 1; } } class B { var $a; var $pageID; function B(&$a,$pageID = 1) { $this->a =& $a; $this->pageID = $pageID; } function showB() { $result = $this->a->query(); if(is_null($this->a)) echo "a = NULL<br/>"; else echo "a = $this->a;<br/>"; echo "pageID = $this->pageID<br?>"; } } $a = new A(); $b = new B($a); $b->showB(); ?>