|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-28 23:14 UTC] felipe@php.net
[2009-09-14 18:22 UTC] sebcsaba at freemail dot hu
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 06:00:01 2025 UTC |
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.