Dmitry Stogov wrote:

Yes I like not a sintetic test but real life example (singleton, factory or
something else).
(I tried to write generic singleton but it wasn't exelent.)

Yeah a singleton method that calls a factory method is a prime example. Now if you want to inherit that class you will have to copy and paste these methods.

Essentially whenever static methods meet inheritance you are quickly likely to need late static binding. Sometimes you can hack around the issue using reflection or requiring the user to pass the in the class name he wants (like in a generic factory). But I do not think you can even solve everything with the reflection API and its certainly not as code efficient.

regards,
Lukas

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

Reply via email to