#41862 [Bgs]: Errorhandler doesn't work

2007-07-02 Thread thomas at thoftware dot de
 ID:   41862
 User updated by:  thomas at thoftware dot de
 Reported By:  thomas at thoftware dot de
 Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  4.4.7
 New Comment:

Neither with require_once(), require(), include() nor with
set_error_handler() anything about the above behaviour is explained. I
checked it four times. Can you please simply give me a direct link to
that part of the documentation where it is mentioned? Or am I supposed
to read the comlplete documentation as in that way you always have the
chance that somewhere there might be some well hidden information about
it?


Previous Comments:


[2007-07-02 01:34:29] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.



[2007-06-30 21:29:30] thomas at thoftware dot de

Description:

Setting an Errorhandler with set_error_handler() and then calling
require() with a Function as Argument doesn't produce the expected
Result.

Reproduce code:
---
  function ehandler($e,$t,$f,$l,$c) {
echo $t;
  }
  function foo($foo) {
return($foo);
  }
  set_error_handler('ehandler');
  error_reporting(E_ALL);
  require_once(foo('foo'));


Expected result:

Some Errormessage like this:

main(foo) [function.main]: failed to open stream: No such file or
directory
Fatal error: main() [function.require]: Failed opening required 'foo'
(include_path='.;c:\php4\pear') in foo.php on line x

Actual result:
--
Nothing (infinite loop?). PHP crashes.

Using no Errorhandler or giving 'foo' directly to require_once() works.





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


#41862 [Bgs]: Errorhandler doesn't work

2007-07-02 Thread thomas at thoftware dot de
 ID:   41862
 User updated by:  thomas at thoftware dot de
 Reported By:  thomas at thoftware dot de
 Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  4.4.7
 New Comment:

Something I found even earlier is: The following error types cannot be
handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR,
E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT
raised in the file where set_error_handler() is called.. Is that what
you mean I should have read? Please note, that that isn't the problem.

I don't want these error types to be handled. I simply want the whole
construct to run and not to crash. The above script works fine in these
2 versions:

Reproduce code 2 (works):
---
  function foo($foo) {
return($foo);
  }
  error_reporting(E_ALL);
  require_once(foo('foo'));

Reproduce code 3 (works):
---
  function ehandler($e,$t,$f,$l,$c) {
echo $t;
  }
  set_error_handler('ehandler');
  error_reporting(E_ALL);
  require_once('foo');

(Where 'fine' means, it shows the error an stops.)

Can you pleease explain to me, why the first version crashes
without any message?


Previous Comments:


[2007-07-02 06:29:19] thomas at thoftware dot de

Neither with require_once(), require(), include() nor with
set_error_handler() anything about the above behaviour is explained. I
checked it four times. Can you please simply give me a direct link to
that part of the documentation where it is mentioned? Or am I supposed
to read the comlplete documentation as in that way you always have the
chance that somewhere there might be some well hidden information about
it?



[2007-07-02 01:34:29] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.



[2007-06-30 21:29:30] thomas at thoftware dot de

Description:

Setting an Errorhandler with set_error_handler() and then calling
require() with a Function as Argument doesn't produce the expected
Result.

Reproduce code:
---
  function ehandler($e,$t,$f,$l,$c) {
echo $t;
  }
  function foo($foo) {
return($foo);
  }
  set_error_handler('ehandler');
  error_reporting(E_ALL);
  require_once(foo('foo'));


Expected result:

Some Errormessage like this:

main(foo) [function.main]: failed to open stream: No such file or
directory
Fatal error: main() [function.require]: Failed opening required 'foo'
(include_path='.;c:\php4\pear') in foo.php on line x

Actual result:
--
Nothing (infinite loop?). PHP crashes.

Using no Errorhandler or giving 'foo' directly to require_once() works.





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