Re: [PHP-DEV] call_user_func, static calls, and $this

2003-08-14 Thread Zeev Suraski
At 09:40 13/08/2003, Brad Bulger wrote: if an object calls one of its methods ($thing->foo()), any static-type method calls made inside there - self::a(), parent::a(), fezbar::a() - will have $this defined, pointing to original calling object. self:: and parent:: are always relative to the contain

Re: [PHP-DEV] call_user_func, static calls, and $this

2003-08-14 Thread Marcus Börger
Hello Brad, Wednesday, August 13, 2003, 9:51:23 AM, you wrote: BB> i can't say. you want to be able to call parent::method() and have $this BB> available there, for sure. it is not truly a static call, it is just syntax BB> that looks like static, i think. (but for sure i don't know!) 'static' BB

Re: [PHP-DEV] call_user_func, static calls, and $this

2003-08-14 Thread Brad Bulger
Marcus Börger wrote: It is very simple: uh oh. :) If this is defined in a static method it is a language error. However when mentioning this problem the acronym BC often gets used for what ever reason. I mean the idea of the new OO model was to have OO in php at least, wasn't it ? i can't say. yo

[PHP-DEV] call_user_func, static calls, and $this

2003-08-14 Thread Brad Bulger
this is old subject everyone is tired of i'm sure. but since large changes have been made to call_user_func[_array] recently, i want to confirm: if an object calls one of its methods ($thing->foo()), any static-type method calls made inside there - self::a(), parent::a(), fezbar::a() - will have $

Re: [PHP-DEV] call_user_func, static calls, and $this

2003-08-14 Thread Marcus Börger
Hello Brad, Wednesday, August 13, 2003, 8:40:37 AM, you wrote: BB> this is old subject everyone is tired of i'm sure. but since large changes BB> have been made to call_user_func[_array] recently, i want to confirm: BB> if an object calls one of its methods ($thing->foo()), any static-type BB>

Re: [PHP-DEV] call_user_func, static calls, and $this

2003-08-14 Thread Brad Bulger
semi-related: __call is somewhat reversed. it will catch call_user_func(array('self','fake')), but not self::fake() (same for parent vs parent:: or randomclass vs randomclass::) the visibility of $this is not changed, so you end up with no $this inside __call. it can be a surprise. -- PHP Interna