On 26 October 2010 15:48, Daniel Convissor
<dani...@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

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

Reply via email to