3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Increment { function __invoke($x) { ++$x->num; } } $c = new Increment(); $a = new \stdClass(); $a->num = 5; call_user_func_array($c, [$a]); var_dump($a);
based on aAVqo
Output for 5.6.0 - 7.2.6
object(stdClass)#2 (1) { ["num"]=> int(6) }