[xdebug-dev] svn: /xdebug/trunk/ tests/bug00391.phpt xdebug.c

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Tue, 29 Dec 2009 17:18:34 +0000

derick Tue, 29 Dec 2009 17:18:34 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=3178

Log:
- Fixed bug #391: Xdebug doesn't stop executing script on catchable fatal errors.

Changed paths:
    A xdebug/trunk/tests/bug00391.phpt
    U xdebug/trunk/xdebug.c

Added: xdebug/trunk/tests/bug00391.phpt
===================================================================
--- xdebug/trunk/tests/bug00391.phpt (rev 0)
+++ xdebug/trunk/tests/bug00391.phpt 2009-12-29 17:18:34 UTC (rev 3178)
@@ -0,0 +1,32 @@
+--TEST--
+Test for bug #391: When PHP runs with Xdebug it doesn't stop executing script when type hinting leads to fatal error.
+--INI--
+log_errors=0
+xdebug.default_enable=1
+--FILE--
+<?php
+
+class A
+{
+ public $x = 1;
+}
+
+class B
+{
+ public function myMethod(A $y)
+ {
+ echo $y, "\n";
+ }
+}
+
+$z = new B();
+$z->myMethod(123);
+echo "And going and going...\n";
+?>
+DONE
+--EXPECTF--
+%satal error: Argument 1 passed to B::myMethod() must be an %s, called in %sbug00391.php on line 17 and defined in %sbug00391.php on line 10
+
+Call Stack:
+%w%f%w%d 1. {main}() %sbug00391.php:0
+%w%f%w%d 2. B->myMethod() %sbug00391.php:17

Modified: xdebug/trunk/xdebug.c
===================================================================
--- xdebug/trunk/xdebug.c 2009-12-29 17:00:17 UTC (rev 3177)
+++ xdebug/trunk/xdebug.c 2009-12-29 17:18:34 UTC (rev 3178)
@@ -2723,6 +2723,9 @@
                 case E_CORE_ERROR:
                 /* no break - intentionally */
                 case E_ERROR:
+#if PHP_VERSION_ID >= 50200
+ case E_RECOVERABLE_ERROR:
+#endif
                 /*case E_PARSE: the parser would return 1 (failure), we can bail out nicely */
                 case E_COMPILE_ERROR:
                 case E_USER_ERROR:
Received on Tue Dec 29 2009 - 17:18:35 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST