PHP analog to C++ member pointers?
Does PHP have something similar to C++ member pointers? I want to use a member of a PHP object, whose name (the member's, not the object's) I only know at runtime. For example:
$object = new stdClass(); $object->NewMember = "value"; $member = 'NewMember'; // I don't know whether this is valid PHP, // but you get what I'm trying to do. echo $object->$member;