Why the following
class AClass { public function __construct () { $this->prop = \"Hello\"; } public function &get () {
what you want can be acheived by this-
prop = "Hello"; } public function &get () { return $this->prop; } protected $prop; } function func (&$ref) { $ref= $ref->get(); } $value = new AClass(); func($value); print_r( $value ); ?>