note 124883 deleted from language.oop5 by crell
| From: | crell@php.net | Date: | Mon, 04 Apr 2022 16:52:43 +0000 |
| Subject: | note 124883 deleted from language.oop5 by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218109@lists.php.net to get a copy of this message | ||
Note Submitter: rjtarpura at gmail dot com
----
We can also access function like this. It looks strange but it works.
<?php
class Foo {
public $aMemberVar = 'aMemberVar Member Variable';
public $aFuncName = 'aMemberFunc';
function aMemberFunc() {
print 'Inside
aMemberFunc()';
}
}
$foo = new Foo;
function getVarName()
{
return 'aFuncName';
}
print $foo->{$foo->{getVarName()}}();