From: demjanich at yandex dot ru
Operating system: WindowsXP
PHP version: 5.0.4
PHP Bug Type: PHP options/info functions
Bug description: Bug with zend.ze1_compatibility_mode auto_prepend_file
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
--
Edit bug report at http://bugs.php.net/?id=34298&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34298&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34298&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34298&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34298&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34298&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34298&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34298&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34298&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34298&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34298&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34298&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34298&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34298&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34298&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34298&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34298&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34298&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34298&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34298&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34298&r=mysqlcfg