3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { $args = func_get_args(); var_dump($args); } } $method = array('Foo', 'bar'); $args = 123; call_user_func($method, $args) // NOT WORKING it just don't goes in the methods call call_user_func($method, 123) // NOT WORKING it just don't goes in the methods call call_user_func($method, (int) 123) // WORKING !! $method = array('Foo', 'bar'); $args = array(123, 456); call_user_func_array($method, $args) // NOT WORKING call_user_func_array($method, (array) $args) // NOT WORKING it just don't goes in the methods call call_user_func_array($method, array((array) $args)) // WORKING !!

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.170.0130.05012.39
5.4.160.0120.05412.38
5.4.150.0090.04512.38
5.4.140.0120.03912.07
5.4.130.0090.04712.05
5.4.120.0100.04312.02
5.4.110.0090.04012.01
5.4.100.0100.03812.01
5.4.90.0130.03712.01
5.4.80.0090.04112.01
5.4.70.0110.04012.01
5.4.60.0100.04312.01
5.4.50.0100.04312.01
5.4.40.0100.04512.00
5.4.30.0110.04211.99
5.4.20.0110.04611.99
5.4.10.0110.03911.99
5.4.00.0100.04211.49
5.3.270.0090.04512.72
5.3.260.0100.04612.72
5.3.250.0110.04812.72
5.3.240.0130.04212.72
5.3.230.0110.04612.71
5.3.220.0130.05412.68
5.3.210.0100.04412.68
5.3.200.0110.04212.68
5.3.190.0070.04712.68
5.3.180.0110.03912.67
5.3.170.0120.04012.67
5.3.160.0120.04112.67
5.3.150.0120.04812.67
5.3.140.0120.03912.66
5.3.130.0100.04212.66
5.3.120.0090.04412.66
5.3.110.0110.04312.66
5.3.100.0090.04212.12
5.3.90.0100.04112.09
5.3.80.0110.03912.08
5.3.70.0080.04112.08
5.3.60.0090.03912.07
5.3.50.0080.04112.01
5.3.40.0120.04112.01
5.3.30.0120.04011.97
5.3.20.0110.04111.75
5.3.10.0100.05211.71
5.3.00.0130.05111.70

preferences:
140.7 ms | 1386 KiB | 7 Q