BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic
| From: | Giovanni Giacobbi | Date: | Sun, 24 Oct 2010 22:38:25 +0000 |
| Subject: | BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-49963@lists.php.net to get a copy of this message | ||
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::
--
Giovanni Giacobbi