ID:               42098
 User updated by:  nicolas dot grekas+php at gmail dot com
 Reported By:      nicolas dot grekas+php at gmail dot com
-Status:           Bogus
+Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      5.2.3
 New Comment:

Ah ah ! You play with words :)

The first time, you said :
- "Only execute time errors can be caught with user error handler.",
and now:
- "during compile -> autoload wont be triggered"

You was wrong the first time ! And you may be right the second time.

But that's still a bug for me in this case. My workaround does exactily
what PHP internals should do automagically, nothing more ! Please
consider it quietly, I'm not submitting this bug for fun. I do know the
workaround now. It's for others developpers around the world who enjoy
PHP a its best...


Previous Comments:
------------------------------------------------------------------------

[2007-08-17 22:40:32] [EMAIL PROTECTED]

And that proves I'm right. __autoload() won't happen during compile.
And this error happens during compile -> autoload wont be triggered.


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

[2007-08-17 22:37:41] nicolas dot grekas+php at gmail dot com

yes, with an include :
replace the eval with include 'toto.php', where toto.php contains
<?php
class A           { function toto(  ) {} }
class B extends A { function toto($a) {} }
?>

this is how I hit the bug the first time

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

[2007-08-17 22:33:17] [EMAIL PROTECTED]

Can you reproduce this without using eval() ?

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

[2007-08-17 21:26:46] nicolas dot grekas+php at gmail dot com

I made some tests, and found a workaround that prove that you are
wrong: the problem is really that __autoload() is not called, and not
that the error_handler is not called.

In reportError() the before the return and it works, just add:
class_exists('errorReporter', false) || __autoload('errorReporter');

and it works. This proves that the error handler is called. (btw,
that's also why I added the "eval" thing in the example. Without the
eval you would be right...)

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

[2007-08-17 21:13:47] [EMAIL PROTECTED]

Of course it doesn't work for this exact error: It's caught during
compile time. Only execute time errors can be caught with user error
handler.

Try change the eval'd code to following:

eval('
class A           { function toto(  ) {} }
A::toto();
');

This works fine..and it's also E_STRICT error.. 

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/42098

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

Reply via email to