Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76451 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40281 invoked from network); 12 Aug 2014 19:01:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2014 19:01:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:52787] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/00-39947-B646AE35 for ; Tue, 12 Aug 2014 15:01:02 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp12.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 0B31B803AB; Tue, 12 Aug 2014 14:52:55 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp12.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id ADE958034F; Tue, 12 Aug 2014 14:52:54 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net [108.66.6.48]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.10); Tue, 12 Aug 2014 18:52:54 GMT Message-ID: <53EA6286.6010909@sugarcrm.com> Date: Tue, 12 Aug 2014 11:52:54 -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: Tom Oram , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Reflection to remove final From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I've just been looking back at the history of this previous conversation... > > http://marc.info/?l=php-internals&m=132673741606531&w=2 > > as a mockist tester I'd really REALLY like to see this be possible but I > can see the problem with the original patch modifying the actual existing > class. > > One solution I propose is rather than modify it would it be possible for > the reflection class to be able to duplicate the class with the finals > removed so something like this could be possible: I don't think it is a good idea. If class is marked as final, there must be a reason why it can not be extended, and if you break that, then bad things can happen - such as we seen in the example of abusing unserializer for internal classes. For internal classes, it may segfault or worse, for user classes, there can be weird undefined behavior. I don't think it is a good idea to allow such things in core. If the class really needs to be extended, just make it not final. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/