Re: [PHP] self in inherited methods

2009-04-21 Thread Alex S Kurilo aka Kamazee
Is it right that 'self' in inherited method still points to the parent? If it is, can you explain it? It makes me worry :) Up until 5.3 this was just the way it was. It has been "fixed" in 5.3. See here for more info: http://php.net/lsb Thanks. It seems that 'static' keyword (instead of 'self')

Re: [PHP] self in inherited methods

2009-04-21 Thread Stuart
2009/4/19 Alex S Kurilo aka Kamazee : > Is it right that 'self' in inherited method still points to the parent? > If it is, can you explain it? It makes me worry :) > > A piece of code below for example > > class MyParent { >       const NAME = 'MyParent'; >       public function get_instance() {

[PHP] self in inherited methods

2009-04-19 Thread Alex S Kurilo aka Kamazee
Is it right that 'self' in inherited method still points to the parent? If it is, can you explain it? It makes me worry :) A piece of code below for example get_instance(); $c = $a->get_another_instance(); echo $a->get_name(),"\n"; echo get_class($b),"\n"; echo get_class($c),"\n"; ?> -- PHP