Re: Reflection to remove final

From: Date: Mon, 11 Aug 2014 10:59:15 +0000
Subject: Re: Reflection to remove final
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-76423@lists.php.net to get a copy of this message
On Sat, Aug 9, 2014 at 12:35 PM, Tom Oram <tom@scl.co.uk> 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 > apart from the thread you linked, we also touched this topic in the following pull request: https://github.com/php/php-src/pull/733 -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.internals (#76423) next »