From:             jules at infinityblue dot com
Operating system: Windows 2000 Server
PHP version:      5.0.0
PHP Bug Type:     Scripting Engine problem
Bug description:  Implicit cloning error 

Description:
------------
I have a small issue with a PHP 4 developed application on PHP5. Current I
get the following error message:

PHP ERROR : , ERROR CODE: 2048, MESSAGE: Implicit cloning object of class
'testErrors' because of 'zend.ze1_compatibility_mode', FILE:
c:\eclipse\workspace\myapp\index_test.php, LINE: 6

I'm loading an error handler. It immediatly trips of the error hander with
the above error.  This code works on PHP 4.2.4.

The following changes were made to the php.ini (taken from
php.ini-recommended) for PHP 5:
zend.ze1_compatibility_mode = On
display_errors = on
error_reporting  =  E_ALL
extension=php_mysql.dll
extension_dir = "ext/"

Server is running on Apache 1.3.29. No segmentation faults have been noted
in the logs


Reproduce code:
---------------
The first file index_test.php looks as follows:
<?
if (!class_exists('testErrors'))
 include "testErrors.php";
$cErrorHandler = new testErrors();
?>

And testErrors.php looks like:
<?
class testErrors {

 function testErrors() {

  function HandleError($number, $message, $file, $line) {
     global $iErrorsShow, $iLogErrors;

   $mErrorMessage = 'PHP ERROR : ';
   $mErrorMessage .= ', ERROR CODE: ' . $number;
   $mErrorMessage .= ', MESSAGE: ' . $message;
   $mErrorMessage .= ', FILE: ' . $file;
   $mErrorMessage .= ', LINE: ' . $line;

   echo "The error message: $mErrorMessage<br>";
  }
  // declare the above function to handle all PHP errors
  set_error_handler('HandleError');
 }
}
?>

Expected result:
----------------
I expect the class to be loaded and the erro handler to be working
*without* echoing the contents of:

echo "The error message: $mErrorMessage<br>";


Actual result:
--------------
The error message: PHP ERROR : , ERROR CODE: 2048, MESSAGE: Implicit
cloning object of class 'testErrors' because of
'zend.ze1_compatibility_mode', FILE:
c:\eclipse\workspace\sitemanager\infinityadmin\index_test.php, LINE: 6

Error handler is set off with the above error message. But in theory no
error should have been caused. 

This error is also error code 2048. This is surely E_STRICT error
reporting, however, php.ini is set to E_ALL. 

-- 
Edit bug report at http://bugs.php.net/?id=29327&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29327&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29327&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29327&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29327&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29327&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29327&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29327&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29327&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29327&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29327&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29327&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29327&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29327&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29327&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29327&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29327&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29327&r=float

Reply via email to