On Mon, Aug 11, 2014 at 12:59 PM, Ferenc Kovacs <tyr...@gmail.com> wrote:
> On Sat, Aug 9, 2014 at 12:35 PM, Tom Oram <t...@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


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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to