php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27836 zend.ze1_compatibility_mode = On gives errors
Submitted: 2004-04-02 08:06 UTC Modified: 2004-04-02 16:18 UTC
From: Robin at RHarmsen dot nl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0RC1 OS: Windows XP
Private report: No CVE-ID: None
 [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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-02 08:35 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
 [2004-04-02 08:55 UTC] Robin at RHarmsen dot nl
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();
?>
 [2004-04-02 16:18 UTC] Robin at RHarmsen dot nl
I just downloaded this CVS version:

php5-win32-200404011830.zip
Built On: Apr 01, 2004 18:30 GMT

and it alreadt seems to be fixed :D

I gues it was one of these (From the news.txt)
- Reimplement zend.ze1_compatibility_mode to have better PHP 4 complicance.
  (Dmitry, Andi)
- Fixed bug #27641 (Object cloning in ze1_compatibility_mode was reimplemented)
  (Dmitry, Andi)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC