php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34298 Bug with zend.ze1_compatibility_mode auto_prepend_file
Submitted: 2005-08-29 19:39 UTC Modified: 2005-08-30 10:44 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: demjanich at yandex dot ru Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5CVS-2005-08-30 OS: WindowsXP
Private report: No CVE-ID: None
 [2005-08-29 19:39 UTC] demjanich at yandex dot ru
Description:
------------
Hello!

There is one bug with zend.ze1_compatibility_mode.
For example, I have three files:
1. D:/localhost/index.php
2. D:/localhost/prepend_file.php
3. .htaccess file

And if I use function error_handler(), then this function catch errors of php4/php5 compatibility. 
So ze1_compatibility_mode don't work in auto prepend file and maybe in auto append file.

Reproduce code:
---------------
index.php
--------------
<?

class Test1
{
	var $foo = 'Test1';
	function Test1()
	{
		echo $this->foo;
	}
}

$Test1 = & new Test1;

$Test1 = new Test1;

?>


prepend_file.php
--------------
<?

//phpinfo();

ini_set('error_reporting',E_ALL);
ini_set('display_errors',1);

class Test
{
	var $foo = 'Test';
	function Test() 
	{
		echo $this->foo; 
	}
}

$Test = new Test;

function error_handler($errno = '', $errstr = '', $errfile = '', $errline = '')
{		
	$errstr_debug = $errstr; 	
	$errmsg_debug = $errno.' '.$errstr."<br />\r\nFile: ".$errfile." Line:".$errline."<br />\r\n";
	echo '<br />'.$errmsg_debug.'<br />';
	
}

set_error_handler('error_handler'); 

?>

.htaccess
--------------
php_flag  zend.ze1_compatibility_mode On
php_value auto_prepend_file D:/localhost/prepend_file.php


Expected result:
----------------
TestTest1Test1

Actual result:
--------------
Test
2048 var: Deprecated. Please use the public/private/protected modifiers
File: d:\localhost\index.php Line:6


2048 Assigning the return value of new by reference is deprecated
File: d:\localhost\index.php Line:13

Test1Test1
2048 Implicit cloning object of class 'Test1' because of 'zend.ze1_compatibility_mode'
File: d:\localhost\index.php Line:15

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-29 23:31 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-08-30 00:29 UTC] demjanich at yandex dot ru
There is the same bug too. In ver 5.1.0-dev and also  in latest brench of 5.0.x-dev.
 [2005-08-30 10:42 UTC] sniper@php.net
Try setting those options in php.ini file instead of .htaccess.

 [2005-08-30 10:43 UTC] sniper@php.net
Also note: zend.ze1_compatibility mode only affects the cloning, nothing else.

 [2005-08-30 10:44 UTC] sniper@php.net
Ah, you have E_STRICT set. No bug here.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 13:01:29 2024 UTC