ID: 49376 Updated by: fel...@php.net Reported By: sebcsaba at freemail dot hu -Status: Open +Status: Bogus Bug Type: Reflection related Operating System: WinXP PHP Version: 5.3.0 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Do not pass any param to method. Just use $rc->newInstanceArgs(); Previous Comments: ------------------------------------------------------------------------ [2009-08-26 16:12:00] sebcsaba at freemail dot hu Description: ------------ I've got a class without a constructor, and I want to instantiate it by ReflectionClass::newInstanceArgs with an empty array as arguments. This causes: ReflectionException: 'Class A does not have a constructor, so you cannot pass any constructor arguments'. If I define an empty default constructor, this works well. Reproduce code: --------------- class A {} $rc = new ReflectionClass('A'); $a = $rc->newInstanceArgs(array()); Expected result: ---------------- Create a new instance of class A, using default constructor behaviour. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49376&edit=1