Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76466 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99819 invoked from network); 13 Aug 2014 09:27:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 09:27:46 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.175 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.175 mail-vc0-f175.google.com Received: from [209.85.220.175] ([209.85.220.175:64883] helo=mail-vc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/00-33745-D8F2BE35 for ; Wed, 13 Aug 2014 05:27:42 -0400 Received: by mail-vc0-f175.google.com with SMTP id ik5so14561391vcb.20 for ; Wed, 13 Aug 2014 02:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=LJT2FHqTPkIUl1ZdmvU4OaavG+mIim6ChSG0owN0HQQ=; b=sTOM2inU2Go8sehLJtwlHistw6zzTdTlzpnM6RmxibSZjH801mv7y7Hnj06y7qXMme ZiKMXjiK5PhXOS0w6cNQfQ5xHCnGVp9e5DYvJKSYR7v2adKEuoLq+rdisS4Pn4kiwwux e7W0snL9l3rpPevkL1XpijttKs5ypopchKzUwIGqSSMAbzqd0ckk4CyWqR4PLwL5JrK+ TxVNUuw0x93VmKo4wdnnFz7etwj2EqGeshVNue+KBOqdIKhba2Bb9Juiu+tHuPnxnDts hyNmeYWyk7wEoo1j/SESmbEi+1tVl1qKwGv9kXFhT170nrl1HKS1MgfH/uA3yi3oAtv7 uiiA== X-Received: by 10.52.165.129 with SMTP id yy1mr3277vdb.57.1407922103706; Wed, 13 Aug 2014 02:28:23 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.30.70 with HTTP; Wed, 13 Aug 2014 02:27:43 -0700 (PDT) In-Reply-To: <53EA6286.6010909@sugarcrm.com> References: <53EA6286.6010909@sugarcrm.com> Date: Wed, 13 Aug 2014 11:27:43 +0200 X-Google-Sender-Auth: R_OZ-8UFQlCSzLM5LOWWiLC_aw0 Message-ID: To: Stas Malyshev Cc: Tom Oram , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Reflection to remove final From: jpauli@php.net (Julien Pauli) On Tue, Aug 12, 2014 at 8:52 PM, Stas Malyshev wrote: > 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. I would argue the same, seems logical to me. Julien.Pauli