From: nicolas dot grekas+php at gmail dot com
Operating system: all
PHP version: 5.2.3
PHP Bug Type: Scripting Engine problem
Bug description: E_STRICT doesn't trigger __autoload()
Description:
------------
See code sample (tested with PHP 5.2.1)
Reproduce code:
---------------
<?php
error_reporting(E_ALL | E_STRICT);
set_error_handler('reportError');
function reportError($code, $message)
{
return errorReporter::report($code, $message);
}
function __autoload($class)
{
class errorReporter
{
static function report($code, $message) { echo $message, '<br
/>'; }
}
}
// When uncommented, this triggers an E_NOTICE, so reportError() is
called,
// which itself calls errorReporter::report(), which triggers
__autoload(),
// which loads the errorReporter class, and everything is fine:
//unset($a);
//echo $a;
// This triggers an E_STRICT, so things should be the same as above,
// exept that __autoload() is never called, so the errorReporter class is
never loaded,
// so we end up with an E_FATAL... BUG
eval('
class A { function toto( ) {} }
class B extends A { function toto($a) {} }
');
Expected result:
----------------
Declaration of B::toto() should be compatible with that of A::toto()
Actual result:
--------------
Fatal error: Class 'errorReporter' not found in [...](35) : eval()'d code
on line 3
--
Edit bug report at http://bugs.php.net/?id=42098&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42098&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42098&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42098&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42098&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42098&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42098&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42098&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42098&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42098&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42098&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42098&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42098&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42098&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42098&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42098&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42098&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42098&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42098&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42098&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42098&r=mysqlcfg