note 5561 deleted from language.oop by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 19:48:59 +0000 |
| Subject: | note 5561 deleted from language.oop by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56186@lists.php.net to get a copy of this message | ||
Note Submitter: cleong@organic.com
----
Note that you can refer to class members with variable variables - something that makes up for the
lack of pointer. The following would yield "Hello world" -
class a {
var $b;
}
$object = new a;
$object->b = "hello";
$member_name = 'b';
echo $object->$member_name;
$object->$member_name = " world";
echo $object->$member_name;