- POSIX:
. Fixed bug #75696 (posix_getgrnam fails to print details of group). (cmb)
+- Reflection:
+ . Fixed bug #74454 (Wrong exception being thrown when using ReflectionMethod).
+ (cmb)
+
- Standard:
. Fixed bug #73457 (Wrong error message when fopen FTP wrapped fails to open
data connection). (Ville Hukkamäki)
switch (Z_TYPE_P(classname)) {
case IS_STRING:
if ((ce = zend_lookup_class(Z_STR_P(classname))) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0,
- "Class %s does not exist", Z_STRVAL_P(classname));
+ if (!EG(exception)) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
+ "Class %s does not exist", Z_STRVAL_P(classname));
+ }
if (classname == &ztmp) {
zval_dtor(&ztmp);
}
--- /dev/null
+<?php
+class A {
+ if (wrongsyntax)
+}
--- /dev/null
+--TEST--
+Bug #74454 (Wrong exception being thrown when using ReflectionMethod)
+--FILE--
+<?php
+spl_autoload_register('load_file');
+try {
+ $x = new ReflectionMethod('A', 'b');
+} catch (\Throwable $e) {
+ echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
+}
+
+function load_file() {
+ require __DIR__ . '/bug74454.inc';
+}
+?>
+===DONE===
+--EXPECTF--
+ParseError: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) or const (T_CONST)
+===DONE===