Hi! > client) I see no reason to keep the limitation in > the ReflectionClass::newInstanceWithoutConstructor() and allowing the > instantiation of internal classes will provide a clean upgrade path to > doctrine and co.
I think we should ensure the objects will be in safe (i.e. no-crashing) state following create_object even if ctor was not called. The question is if we can ensure that and what would be the effort. As for upgrade path for doctrine, etc. - if we're talking about something like test mocking, wouldn't something like: class Mock_Stub_FooClass extends FooClass { function __construct() {} } $foo = new Mock_Stub_FooClass(); solve the problem? I understand it's not argument against newInstanceWithoutConstructor as essentially it does the same, just saying newInstanceWithoutConstructor strictly speaking would not be necessary? I think an approach for this would be to take pull 733 and make a script (or a test) that takes all the classes we define internally (may be a bit hard since some extensions need external libs, but we can check those manually) and instantiate them using this (and all other non-standard) method and try to call random methods and see if we get any crashes. But we should be reasonably sure at least most common ones would not crash if we enable this. Another question would be if objects like COM would react to this properly. But if not it would be possible to make them final too. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php