On Monday, January 28, 2013 11:30 PM, Zeev Suraski wrote:
Alan,

Can you explain why you think it's a major BC break?  The RFC suggested that
the BC break would be minimal and that the likelihood a lot of people used
it is very low.  If you think differently and share it it might put it in a
different light.

Zeev
This is an example of recently written code that from my understanding will now generate a E_DEPRECATED based on that RFC

http://git.roojs.org/?p=pear;a=blob;f=Document/Word/Writer/Section/TextRun.php;hb=HEAD#l136

The concept there is
Class ... Section

Class ...Section_Footer extends ...Section

Class ...Section_TextRun extends ..Section

The method 'addPreserveText' is in Footer, however the method is needed in TextRun, so It's called statically (expecting $this to be similar, as the both extend the same base class).

Yes, this could be fixed other ways (putting addPreserveText to 'Section') or a Trait,
however the current method has a number of benefits
a) the code is easy to follow - hence we can get anyone to understand it quickly. b) putting it in the parent class would expose it to the children (where it may not be valid) c) traits would add a little extra complexity, and make the code a little bit more difficult to follow.

I've used this in other places, it's basically lightweight traits, and has always been perfectly valid code. There does not seem to be a clear justification for deprecating it other than, It's not the way 'some' people like code to work...

Regards
Alan

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

Reply via email to