<?php
class TestClass {
public $hello = '';
}
function modify($obj) {
$obj->hello = 'world (modified)!';
}
$obj = new TestClass();
$obj->hello = 'world';
modify($obj);
var_dump($obj->hello); // outputs "world (modified!)"
PD9waHAKCmNsYXNzIFRlc3RDbGFzcyB7CglwdWJsaWMgJGhlbGxvID0gJyc7Cn0KCmZ1bmN0aW9uIG1vZGlmeSgkb2JqKSB7Cgkkb2JqLT5oZWxsbyA9ICd3b3JsZCAobW9kaWZpZWQpISc7Cn0KCiRvYmogPSBuZXcgVGVzdENsYXNzKCk7CiRvYmotPmhlbGxvID0gJ3dvcmxkJzsKCm1vZGlmeSgkb2JqKTsKCnZhcl9kdW1wKCRvYmotPmhlbGxvKTsgIC8vIG91dHB1dHMgIndvcmxkIChtb2RpZmllZCEpIgo=