Re: BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic
| From: | Richard Quadling | Date: | Tue, 26 Oct 2010 15:46:23 +0000 |
| Subject: | Re: BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49974@lists.php.net to get a copy of this message | ||
On 26 October 2010 15:48, Daniel Convissor
<danielc@analysisandsolutions.com> wrote:
> On Mon, Oct 25, 2010 at 12:56:28AM +0200, Etienne Kneuss wrote:
>
>> Exactly, if Bar::getFoo is not called statically, parent::getFoo() will
>> not be a static call, it should not get through __callStatic.
>
> That logic sounds good. Unfortunately, things aren't behaving that way:
>
> <?php
>
> // Rework of code from http://bugs.php.net/bug.php?id=51176
> class p {
> public function __call($n, $a) {
> echo "call\n";
> }
>
> public static function __callStatic($n, $a) {
> echo "callStatic\n";
> }
> }
>
> class c extends p {
> public function existing() {
> parent::non_existing();
> }
> }
>
> $c = new c;
> echo 'static = ';
> c::s();
> echo 'object = ';
> $c->o();
> echo 'parent = ';
> $c->existing();
>
> echo phpversion() . "\n";
>
>
> Thanks,
>
> --Dan
So the calling context/scope is going to have to be used to determine
if the call should get to __call or __callStatic.
Is that possible? Appropriate? Easy to do? Done by Friday?
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY