note 1558 deleted from language.oop by sander
| From: | sander@php.net | Date: | Sat, 06 Apr 2002 18:48:57 +0000 |
| Subject: | note 1558 deleted from language.oop by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28722@lists.php.net to get a copy of this message | ||
The following example doesn't work in PHP3 but will work in PHP4.
class test_class {
function useless(){
print "useless";
}
}
$test = new test_class;
$foo = "test";
${$foo}->useless();
You can do it in PHP3 but use :
$GLOBALS[$foo]->useless();
instead of the last line.