From 9ea04e1e46f0e4e01d5c96ddf46a738abeafb73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Sun, 21 Nov 2010 12:24:09 +0000 Subject: - Fix #52854 (ReflectionClass::newInstanceArgs does not work for classes without constructors --- ext/reflection/php_reflection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 46e49ccd0c..6ad9128801 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4013,7 +4013,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs) if (params) { efree(params); } - } else if (!ZEND_NUM_ARGS()) { + } else if (!ZEND_NUM_ARGS() || !argc) { object_init_ex(return_value, ce); } else { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name); -- cgit v1.2.1