From d586441d902ebabf2300b6724a2217e07bb12803 Mon Sep 17 00:00:00 2001 From: Ferenc Kovacs Date: Wed, 23 Jul 2014 07:45:02 +0200 Subject: ReflectionClass::newInstanceWithoutConstructor() should be allowed to instantiate every class except those internal classes with a final __construct() --- ext/reflection/php_reflection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 02a19c0aaa..8ccd5e6f62 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4308,8 +4308,8 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor) METHOD_NOTSTATIC(reflection_class_ptr); GET_REFLECTION_OBJECT_PTR(ce); - if (ce->create_object != NULL) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s is an internal class that cannot be instantiated without invoking its constructor", ce->name); + if (ce->create_object != NULL && ce->ce_flags & ZEND_ACC_FINAL_CLASS) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s is an internal class with a final __construct thus cannot be instantiated without invoking its constructor", ce->name); } object_init_ex(return_value, ce); -- cgit v1.2.1