Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76149 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62466 invoked from network); 25 Jul 2014 22:29:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2014 22:29:13 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.75 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.75 smtp75.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.75] ([108.166.43.75:44239] helo=smtp75.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/CF-08559-83AD2D35 for ; Fri, 25 Jul 2014 18:29:12 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp10.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id C33883804A0; Fri, 25 Jul 2014 18:29:16 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp10.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E8422380536; Fri, 25 Jul 2014 18:29:15 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.10); Fri, 25 Jul 2014 22:29:16 GMT Message-ID: <53D2DA3B.9020308@sugarcrm.com> Date: Fri, 25 Jul 2014 15:29:15 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Ferenc Kovacs , Alexey Zakhlestin CC: Marco Pivetta , Sebastian Bergmann , Julien Pauli , Remi Collet , PHP Internals References: <53A1C722.9060501@fedoraproject.org> <53A21137.6010705@sugarcrm.com> <53A2A9BD.1070603@sugarcrm.com> <53A3874E.20704@sugarcrm.com> <53A62AFF.4080302@sugarcrm.com> <53B10D59.4060206@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Problems with the fix for the BC break introduced in 5.4.29 and 5.5.13 From: smalyshev@sugarcrm.com (Stas Malyshev) 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/