PHP call_user_func with with an object instance, passing parameters to the method.

Thu, 12 September 2019

php
example.php
<?php
$obj = new MyObject();
$method = 'myMethod';
$args = [true, 1];

$result = call_user_func([$obj, $method], ...$args);
// Done.
php