|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-02 11:05 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Feb 09 16:00:01 2026 UTC |
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.