Alan Knowles wrote:

the E_STRICT warnings on static calls to non static methods are probably usefull, (as $this could be defined totally randomly), so it does make some sense..

btw: does that mean:

class a { function find() { } }
class b extends a { function find() { } }

// call the toplevel parent method.. (skip the imediate parent)
class c extends b { function find() { a::find() } }
$a = new c;
$c->find();

illicits and E_STRICT warning???

Hmm --yes unless you declare a::find() as a 'static' method. The good news is that static methods can be used on objects w/ no errors (so you can definitely accomplish that design, but would just have to declare methods as 'static').


So, basically:
- if you try to call a "normal" method statically you will get E_STRICT notice
- if you make any reference to $this in a 'static' method you will get E_FATAL error


(Correct me if I'm missing anything)

Hans

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



Reply via email to