- SPL:
. Fixed bug #74977 (Appending AppendIterator leads to segfault).
(Andrew Nester)
- . Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach loop).
- (jhdxr)
+ . Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach
+ loop). (jhdxr)
+ . Fixed bug #74372 (autoloading file with syntax error uses next autoloader,
+ may hide parse error). (Nikita)
- SQLite3:
. Updated bundled libsqlite to 3.21.0. (cmb)
. bcmul() and bcpow() now return numbers with the requested scale. Formerly,
the returned numbers may have omitted trailing decimal zeroes.
+SPL:
+ . If an SPL autoloader throws an exception, following autoloaders will not be
+ executed. Previously all autoloaders were executed and exceptions were
+ chained.
+
Standard:
. getimagesize() and related functions now report the mime type of BMP images
as image/bmp instead of image/x-ms-bmp, since the former has been registered
}
zend_call_function(&fci, &fcic);
-
- zend_exception_save();
zval_ptr_dtor(&retval);
+
+ if (EG(exception)) {
+ break;
+ }
+
if (pos + 1 == SPL_G(autoload_functions)->nNumUsed ||
zend_hash_exists(EG(class_table), lc_name)) {
break;
}
zend_hash_move_forward_ex(SPL_G(autoload_functions), &pos);
}
- zend_exception_restore();
zend_string_release(lc_name);
SPL_G(autoload_running) = l_autoload_running;
} else {
--- /dev/null
+--TEST--
+Bug #74372: autoloading file with syntax error uses next autoloader, may hide parse error
+--FILE--
+<?php
+
+spl_autoload_register(function($class) {
+ eval("ha ha ha");
+});
+spl_autoload_register(function($class) {
+ echo "Don't call me.\n";
+});
+
+new Foo;
+
+?>
+--EXPECTF--
+Parse error: syntax error, unexpected 'ha' (T_STRING) in %s on line %d
--EXPECTF--
TestFunc1(TestClass)
TestFunc2(TestClass)
-TestFunc3(TestClass)
Exception: Class TestClass missing
===DONE===
===DONE===
--EXPECTF--
autoload_first
-autoload_second
-second
first
autoload_first
-autoload_second
-second
first
autoload_first
-autoload_second
Fatal error: Uncaught Exception: first in %sspl_autoload_012.php:%d
Stack trace:
#1 [internal function]: spl_autoload_call('ThisClassDoesNo...')
#2 %sspl_autoload_012.php(%d): class_exists('ThisClassDoesNo...')
#3 {main}
-
-Next Exception: second in %sspl_autoload_012.php:%d
-Stack trace:
-#0 [internal function]: autoload_second('ThisClassDoesNo...')
-#1 [internal function]: spl_autoload_call('ThisClassDoesNo...')
-#2 %sspl_autoload_012.php(%d): class_exists('ThisClassDoesNo...')
-#3 {main}
- thrown in %sspl_autoload_012.php on line %d
+ thrown in %s on line %d