Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76431 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38686 invoked from network); 11 Aug 2014 16:09:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2014 16:09:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.169 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.169 mail-vc0-f169.google.com Received: from [209.85.220.169] ([209.85.220.169:43158] helo=mail-vc0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/52-22956-BAAE8E35 for ; Mon, 11 Aug 2014 12:09:16 -0400 Received: by mail-vc0-f169.google.com with SMTP id le20so11995045vcb.0 for ; Mon, 11 Aug 2014 09:09:54 -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=gCWvIwFfmgG1FmTBpi+KNT+J6aHn0cRtLn3lIazs5OQ=; b=fEX/3IqweCZYCBU1OWT9cLnHsv8qH2VDMg1Seq6PIZw7CmLXzshQjU6XPPHWOTXWoP 8ZGhg2nyJHS1H7rTw3dej8VOdAm+LhP/ZxmoE63tEOWedUrfqJZwibpSKC9aagQrj6HP 4MRQ3NNO8pAVV/gf9/jpeY3v/52Wdj0Ee4xzsXS+V6Uaq1+dkfwep4Y0w5Kg9WiOuW+3 mc16HBq4VS6pkgSWKDo9hZc9giWzp3vcfKcXv4n4fVbR6khPEXN1HlRCAtWwzWrhJGDm o8ufUJ49uGqld1LzAvki6y+su3hHolslnfByiT6wTX3uUOMs6wSi0h1vhNGpye74uBps IbTw== X-Received: by 10.221.24.7 with SMTP id rc7mr1082262vcb.54.1407773394047; Mon, 11 Aug 2014 09:09:54 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.30.70 with HTTP; Mon, 11 Aug 2014 09:09:13 -0700 (PDT) In-Reply-To: References: Date: Mon, 11 Aug 2014 18:09:13 +0200 X-Google-Sender-Auth: Xfg1OJKyxh35uaC7lPXd6zZrblw Message-ID: To: Ferenc Kovacs 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 Mon, Aug 11, 2014 at 12:59 PM, Ferenc Kovacs wrote: > On Sat, Aug 9, 2014 at 12:35 PM, Tom Oram wrote: > >> 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: >> >> final class A >> { >> } >> >> $r = new ReflectionClass('A'); >> >> $r->defineExtendableClass('ExtendableA'); >> >> class MockA extends ExtendabledA >> { >> } >> >> I'm unfamiliar with the PHP codebase so I thought I'd just ask here to find >> out if it sounds possible before diving into the code >> >> Thoughts? >> >> Regards, >> Tom Supporting this at an engine level would be harder than you think. We already had lots of difficulties patching newInstanceWithoutConstructor() to support internal classes (5.6) because they've never been designed to support creation without the call to their constructor. Removing (or giving a way to remove) FINAL should be OK for userland classes, but that will be hard to support for internal classes and would require lots of work. Some of them could even never support it. Julien.Pauli