Edit report at http://bugs.php.net/bug.php?id=52762&edit=1
ID: 52762
Comment by: jeanseb at au-fil-du dot net
Reported by: morpika at vipmail dot hu
Summary: autoload not called inside create_function
Status: Open
Type: Bug
Package: *Programming Data Structures
Operating System: FreeBSD 8.0
PHP Version: 5.3.3
Block user comment: N
New Comment:
Reproduce on PHP 5.2.6 & 5.2.12
Previous Comments:
------------------------------------------------------------------------
[2010-09-01 18:56:16] morpika at vipmail dot hu
Description:
------------
If i define my own error handler with the use of the set_error_handler
and the create_function functions, then the 'errors' class inside the
create_function triggers the autoload function by errors that user
defined error handlers can handle. It's OK!
But when i make an E_STRICT error for example by defining the 'connect'
function in class 'a' (which already exists in the built in mysqli
class), then it won't call the autoload function, it gives me a fatal
error for not finding the 'errors' class.
What i expected:
a) If this type of E_STRICT error cann't be handled by my own error
handler, then PHP's default error handler should have been used.
b) If this type of E_STRICT error can be handled by my own error
handler, then the __autoload function should have been called as a last
chance for opening the 'errors' class.
Test script:
---------------
index.php:
<?php
set_error_handler(create_function('', 'errors::php_error();'));
function __autoload($class_name) { die('autoload called'); }
include('mysql.php');
?>
mysql.php:
<?php
class a extends mysqli {
function connect() {}
}
?>
Expected result:
----------------
autoload called
Actual result:
--------------
Fatal error: Class 'errors' not found in mysql.php on line 7
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52762&edit=1