Edit report at https://bugs.php.net/bug.php?id=54054&edit=1

 ID:                 54054
 Comment by:         phil at propcom dot co dot uk
 Reported by:        morpika at vipmail dot hu
 Summary:            Autoload not called in user-defined error handler
                     function in case of E_STRICT
 Status:             Open
 Type:               Bug
 Package:            *Programming Data Structures
 Operating System:   FreeBSD 8.0
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

This is still an issue.

The 2 test cases below should hopefully sum this up for you.

Case 1...

include() call fails and generates an E_WARNING
E_WARNING is caught by the error handler
Error handler attempts to use \Error class and calls the autoloader because it 
is not currently loaded

...Case 2

The included file (http://codepad.viper-7.com/xyCn8C) generates an E_STRICT
E_STRICT is caught by the error handler
Error handler attempts to use \Error class and fails with a fatal error WITHOUT 
calling the autoloader

The problem is that, in case 2, it is expected that the autoloader would be 
used to load the \Error class. This doesn't appear to be the case.



Case 1: http://codepad.viper-7.com/b065B1

Case 2: http://codepad.viper-7.com/qi5185
Included file (xyCn8C) in Case 2: http://codepad.viper-7.com/xyCn8C


Previous Comments:
------------------------------------------------------------------------
[2011-02-19 14:39:37] morpika at vipmail dot hu

Description:
------------
__autoload function is not called in user-defined error handler function in 
case of E_STRICT error. In case of any other type of errors (thet user-defined 
error handler function can handle) the autoload function is called properly.

Test script:
---------------
test.php:

<?php
set_error_handler('php_error');
function php_error($errno, $errcode) { t_class::t_function($errno, $errcode); }
function __autoload($class_name) { echo 'autoload called'; exit; }
require('nf.php');
?>

nf.php (to create an E_STRICT ERROR: Redefining already defined constructor):

<?php
class number_format {
public function __construct() {}
public function number_format($number) { echo number_format($number, 0, '.', 
'.'); }
}
?>

Expected result:
----------------
autoload called

Actual result:
--------------
Fatal error: Class 't_class' not found


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=54054&edit=1

Reply via email to