Re: BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic
| From: | Felipe Pena | Date: | Wed, 03 Nov 2010 01:38:43 +0000 |
| Subject: | Re: BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50089@lists.php.net to get a copy of this message | ||
2010/10/24 Giovanni Giacobbi <giovanni@giacobbi.net>
>
> Greetings,
>
> in reference to bug #52713 i'd like to inquire you about this decision
> which actually broke my codebase in different parts.
>
> The situation is this one:
>
> class ActiveRecord {
>
> public function __call($method, $args) {
> if ($method == "getFoo") {
> // implement some default behaviour for getFoo()
> }
> }
>
> public function __callStatic($method, $args) {
> // do some other stuff
> }
> }
>
>
> class Bar {
> // override getFoo() to add some specific behaviour
> public function getFoo() {
> // do the specific stuff
> parent::getFoo();
> }
> }
>
>
> Until version 5.3.2 this worked fine, starting from version 5.3.3
> parent::getFoo() calls __callStatic() instead of __call().
>
> This is a really bad BC change which i thought you decided to accept only
> in minor versions change and not patch-level versions change.
>
> Anyway, I would even be willing to do some changes to my codebase, but what
> is the solution? I can't see any other way to do this with the obvious
> assumptions that my design is good and that I don't know anything about the
> parent class except there is a getFoo() method implemented somehow.
>
> My wish is that you restore the 5.3.2 behaviour, which sounds very
> reasonable, and maybe introduce another way when you actually want to get
> rid of the context, something like static::
>
>
The change has been reverted in SVN.
Thanks.
--
Regards,
Felipe Pena