summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorFerenc Kovacs <tyrael@php.net>2014-07-23 07:45:02 +0200
committerFerenc Kovacs <tyrael@php.net>2014-07-30 10:08:56 +0200
commitd586441d902ebabf2300b6724a2217e07bb12803 (patch)
tree9bd8ceb076d1d09e53f9ffc34edfadd59a5d8b0d /ext/reflection/php_reflection.c
parent43e956a9a1b72dda31f24f1fc9804e19f3391dd4 (diff)
downloadphp-git-d586441d902ebabf2300b6724a2217e07bb12803.tar.gz
ReflectionClass::newInstanceWithoutConstructor() should be allowed to instantiate every class except those internal classes with a final __construct()
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c4
1 files changed, 2 insertions, 2 deletions
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);