summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2011-06-07 22:58:38 +0000
committerFelipe Pena <felipe@php.net>2011-06-07 22:58:38 +0000
commit08b3d76cbf74d7c1d1438381dae340660c44edfc (patch)
tree33b0db2873d495b7ab7f337320eec1d1916302cf
parentaf43d306c0467f7f31eb30caf7c73ea90316fe60 (diff)
downloadphp-git-08b3d76cbf74d7c1d1438381dae340660c44edfc.tar.gz
- Fixed bug #55007 (compiler fail after previous fail)
-rw-r--r--Zend/tests/bug55007.phpt23
-rw-r--r--Zend/zend.c1
2 files changed, 24 insertions, 0 deletions
diff --git a/Zend/tests/bug55007.phpt b/Zend/tests/bug55007.phpt
new file mode 100644
index 0000000000..12fbf120a8
--- /dev/null
+++ b/Zend/tests/bug55007.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #55007 (compiler fail after previous fail)
+--FILE--
+<?php
+
+function __autoload($classname) {
+ if ('CompileErrorClass'==$classname) eval('class CompileErrorClass { function foo() { $a[] } }');
+ if ('MyErrorHandler'==$classname) eval('class MyErrorHandler { function __construct() { print "My error handler runs.\n"; } }');
+}
+
+function shutdown() {
+ new MyErrorHandler();
+}
+
+
+register_shutdown_function('shutdown');
+
+new CompileErrorClass();
+
+?>
+--EXPECTF--
+Fatal error: Cannot use [] for reading in %s(%d) : eval()'d code on line %d
+My error handler runs.
diff --git a/Zend/zend.c b/Zend/zend.c
index 07bdf98a56..638de824b1 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -849,6 +849,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
exit(-1);
}
CG(unclean_shutdown) = 1;
+ CG(active_class_entry) = NULL;
CG(in_compilation) = EG(in_execution) = 0;
EG(current_execute_data) = NULL;
LONGJMP(*EG(bailout), FAILURE);