- var_dump: documentation ( source)
- forward_static_call: documentation ( source)
<?php
class Foo {
protected function y() {
echo 'Foo called' . PHP_EOL;
var_dump( func_get_args());
}
}
class Bar extends Foo {
public function __call($name, $args)
{
echo 'Bar called' . PHP_EOL;
/** This works, but arg[0] is the name of the method called and [1] is the args
call_user_func_array(
'parent::' . $name,
func_get_args()
);
*/
forward_static_call(
['parent', $name],
func_get_args()[1]
);
}
}
$bar = (new Bar)->y(4,2);