Q:

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;

A:

You can use variables in member calls.
$methodName = 'some_method';
$myObj->$methodName($param);

Not sure if this will work for what you want.

