note 50310 added to keyword.paamayim-nekudotayim

From: Date: Thu, 24 Feb 2005 12:33:31 +0000
Subject: note 50310 added to keyword.paamayim-nekudotayim
Groups: php.notes 
Request: Send a blank email to php-notes+get-85481@lists.php.net to get a copy of this message
It's worth noting that you can't use a variable with this operator. The following is legal: class MyObject { function myfunc() { return "Hello!"; } } $type = "MyObject"; $object = new $type(); $message = $object->myfunc(); (Puts "hello" in $message) You can also use the scope operator: $message = MyObject::myfunc(); However, the following is NOT legal: $message = $type::myfunc(); It's a pity, 'cos right now I've got a situation where it'd be really handy, but that's the way it goes! ---- Manual Page -- http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50310 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50310&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50310&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50310&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50310&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50310&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50310&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85481) next »