- error_reporting: documentation ( source)
- strtolower: documentation ( source)
<?php
error_reporting(-1);
class a {
public function b(&$name, $junk) {
$name = strtolower($name).$junk;
}
}
$name = 'Rasmus';
$junk = 'junk';
$arguments = [$name, $junk];
$obj = new a;
$reflectionMethod = new ReflectionMethod('a', 'b');
$closure = $reflectionMethod->getClosure($obj);
$closure(...$arguments);
echo $arguments[0];