I'd like to implement a pure function in PHP
How do I pass an object by value and not by reference?
In other words, this is the expected output:
function change($obj) {
$obj->set_value(2);
}
$obj = new Object();
$obj->set_value(1);
change($obj);
echo $obj->get_value(); // 1