I'm using PHP 4.3.3 (cli) and found that with
phpunit.php 1.11
I have to take care of set_error_handler on FALSE. Here are
the differences:
dhcp106$ diff phpunit/phpunit.php ~/phpunit.php
8c8
< // $Id: phpunit.php,v 1.11 2002/10/31 18:44:12 fredy
Exp $
---
> // $Id: phpunit.php,v 1.1 2004/02/18 12:15:59
queinnec Exp queinnec $
241c241,244
< set_error_handler($old_handler); // revert to
prior error handler
---
> if ( $old_handler ) {
> // revert to prior error handler
> set_error_handler($old_handler);
> };
632c635
< ?>
\ No newline at end of file
---
> ?>
Logged In: YES
user_id=864439
Originator: NO
I just ran into the same thing. It seems as if no error handler is set by default, so trying to restore the old error handler always fails the first time around. Why not use restore_error_handler(), which seems to work more gracefully with the case of a nonexistent callback? Like so:
Index: phpunit.php
--- phpunit.php (revision 4321)
+++ phpunit.php (working copy)
@@ -238,7 +238,7 @@
$this->$name();
if (phpversion() >= '4') {
- set_error_handler($old_handler); // revert to prior error handler
+ restore_error_handler(); // revert to prior error handler
$PHPUnit_testRunning = null;
}
}