I have a class in PHP like so:
class ParentClass { function __construct($arg) { // Initialize a/some variable(s) based on $arg } } >
class ParentClass { function __construct($arg) { // Initialize a/some variable(s) based on $arg } }
This can be done in PHP >= 5.6 without call_user_func_array() by using the ... (splat) operator:
call_user_func_array()
public function __construct() { parent::__construct(...func_get_args()); }