Edit report at https://bugs.php.net/bug.php?id=55490&edit=1
ID: 55490 Patch added by: sebast...@php.net Reported by: sebast...@php.net Summary: Allow instantiating objects without invoking the constructor Status: Open Type: Feature/Change Request Package: Reflection related Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: ReflectionClass_newInstanceWithoutConstructor Revision: 1314265167 URL: https://bugs.php.net/patch-display.php?bug=55490&patch=ReflectionClass_newInstanceWithoutConstructor&revision=1314265167 Previous Comments: ------------------------------------------------------------------------ [2011-08-25 09:27:08] sebast...@php.net The following patch has been added/updated: Patch Name: ReflectionClass_newInstanceWithoutConstructor Revision: 1314264428 URL: https://bugs.php.net/patch-display.php?bug=55490&patch=ReflectionClass_newInstanceWithoutConstructor&revision=1314264428 ------------------------------------------------------------------------ [2011-08-25 09:24:37] sebast...@php.net The following patch has been added/updated: Patch Name: ReflectionClass_newInstanceWithoutConstructor Revision: 1314264277 URL: https://bugs.php.net/patch-display.php?bug=55490&patch=ReflectionClass_newInstanceWithoutConstructor&revision=1314264277 ------------------------------------------------------------------------ [2011-08-23 12:31:07] sebast...@php.net Description: ------------ Libraries such as Doctrine 2 and PHPUnit_MockObject (ab)use the unserialize() function (unserialize(sprintf('O:%d:"%s":0:{}', strlen($name), $name))) to instantiate an object of a class without invoking the constructor. It would be nice if the Reflection API provided a clean API for this use case that does not depend on implementation details of PHP's serializer. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55490&edit=1