On Tue, Aug 12, 2014 at 8:52 PM, Stas Malyshev <smalys...@sugarcrm.com> 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

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

Reply via email to