static method and $this

From: Date: Thu, 07 Aug 2003 08:42:10 +0000
Subject: static method and $this
Groups: php.general 
Request: Send a blank email to php-general+get-158623@lists.php.net to get a copy of this message
hello php-general, i found this thread in the mailing-list archive: http://marc.theaimsgroup.com/?l=php-general&m=104182777004472&w=2 to summarize: if you call a static method FooClass::foo() from within an object-method (for example: class BarClass { function bar() { Foo::foo(); } } $obj = new BarClass; $obj->bar(); ) FooClass::foo() will have a reference "$this" defined that is a reference to $obj. i noticed recently that this still works in the beta1 of php5. my question: does anybody have a clue if this is a well-known and supported feature? or is it just a side-effect and using it can be a bad design-decision in the long run? greetings messju

« previous php.general (#158623) next »