3v4l.org

run code in 200+ PHP versions simultaneously
<?php // An example callback function function my_callback_function() { echo 'hello world!', PHP_EOL; } // Callback methods in classes class ParentClass { static function myCallbackMethod() { echo 'Hello Parent!', PHP_EOL; } } class MyClass extends ParentClass { static function myCallbackMethod() { echo 'Hello Child!', PHP_EOL; } } class Invokable { public function __invoke() { echo 'Hello Invokable', PHP_EOL; } } $obj = new MyClass(); $invokable = new Invokable(); $callbacks = array( 'type1' => 'my_callback_function', 'type2' => array('MyClass', 'myCallbackMethod'), 'type3' => array($obj, 'myCallbackMethod'), 'type6' => $invokable, 'type7' => function() { echo 'Hello Closure', PHP_EOL; }, 'type4' => 'MyClass::myCallbackMethod', 'type5' => array('MyClass', 'parent::myCallbackMethod'), ); foreach( $callbacks as $key => $callback ) { echo PHP_EOL, 'Testing ', $key, PHP_EOL; var_dump(is_callable($callback)); call_user_func($callback); try { $callback(); } catch( Error $e ) { echo $e->getMessage(), PHP_EOL; } }
based on CrEev

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)
7.4.00.0000.01415.07
7.3.70.0000.02214.59
7.3.60.0130.00414.58
7.3.50.0130.00514.73
7.3.40.0080.00914.70
7.3.30.0110.00814.39
7.3.20.0120.00814.56
7.3.10.0150.00814.55
7.3.00.0080.01214.68
7.2.200.0090.00914.84
7.2.190.0080.00814.90
7.2.180.0070.01014.66
7.2.170.0130.00514.96
7.2.160.0100.01014.96
7.2.150.0180.00714.68
7.2.140.0060.01215.18
7.2.130.0120.01214.62
7.2.120.0070.01314.67
7.2.110.0170.00314.93
7.2.100.0140.01014.75
7.2.90.0140.01114.95
7.2.80.0110.01114.71
7.2.70.0180.00415.02
7.2.60.0140.00614.62
7.2.50.0170.01114.74
7.2.40.0090.01514.86
7.2.30.0080.01214.93
7.2.20.0170.00615.11
7.2.10.0200.00414.98
7.2.00.0120.00614.93
7.1.300.0210.00313.75
7.1.290.0120.00613.65
7.1.280.0100.01013.82
7.1.270.0170.01113.80
7.1.260.0140.00713.74
7.1.250.0480.01013.53
7.1.240.0170.00914.09
7.1.230.0200.00313.88
7.1.220.0150.00813.73
7.1.210.0140.00713.82
7.1.200.0160.00313.81
7.1.190.0180.00713.85
7.1.180.0190.00413.63
7.1.170.0210.00313.95
7.1.160.0170.00713.86
7.1.150.0150.01113.97
7.1.140.0160.00814.07
7.1.130.0170.00614.18
7.1.120.0160.01014.20
7.1.110.0210.00713.79
7.1.100.0280.00614.06
7.1.90.0120.01214.19
7.1.80.0140.00513.76
7.1.70.0130.00613.51
7.1.60.0120.00513.76
7.1.50.0120.01213.59
7.1.40.0210.00313.81
7.1.30.0130.00613.80
7.1.20.0140.01113.84
7.1.10.0190.00313.59
7.1.00.0190.00313.93
7.0.330.0120.00913.55
7.0.320.0220.00413.54
7.0.310.0130.01013.40
7.0.300.0100.01013.32
7.0.290.0180.01213.77
7.0.280.0070.01313.55
7.0.270.0490.00413.49
7.0.260.0190.00413.60
7.0.250.0230.00313.42
7.0.240.0100.01413.60
7.0.230.0170.00713.43
7.0.220.0150.00613.68
7.0.210.0080.01013.33
7.0.200.0120.01213.49
7.0.190.0180.00613.74
7.0.180.0150.01013.65
7.0.170.0150.00713.51
7.0.160.0110.01113.32
7.0.150.0130.01013.48
7.0.140.0130.01013.55
7.0.130.0560.00413.56
7.0.120.0130.00513.74
7.0.110.0160.00613.39
7.0.100.0000.02213.85
7.0.90.0180.00313.48
7.0.80.0200.00413.65
7.0.70.0200.00313.86
7.0.60.0170.00313.62
7.0.50.0150.00713.48
7.0.40.0150.00713.44
7.0.30.0200.00613.66
7.0.20.0220.01313.60
7.0.10.0140.00613.82
7.0.00.0150.00913.74
5.6.400.0120.00814.02
5.6.390.0180.00014.37
5.6.380.0120.00914.35
5.6.370.0130.00614.46
5.6.360.0130.00714.30
5.6.350.0180.00713.98
5.6.340.0110.01114.36
5.6.330.0110.01114.49
5.6.320.0150.00714.41
5.6.310.0110.00514.43
5.6.300.0190.00314.29
5.6.290.0040.01214.33
5.6.280.0060.01214.33
5.6.270.0100.01014.05
5.6.260.0110.01314.18
5.6.250.0180.00514.33
5.6.240.0150.00614.07
5.6.230.0150.00814.21
5.6.220.0070.01314.44
5.6.210.0180.00414.36
5.6.200.0130.00814.36
5.6.190.0120.00614.33
5.6.180.0200.00014.25
5.6.170.0120.01014.14
5.6.160.0030.01714.06
5.6.150.0130.00813.88
5.6.140.0140.00614.20
5.6.130.0150.00814.29
5.6.120.0110.01514.39
5.6.110.0160.00514.42
5.6.100.0040.01614.08
5.6.90.0090.00914.25
5.6.80.0060.01114.13
5.6.70.0130.00914.37
5.6.60.0080.01114.32
5.6.50.0110.00814.05
5.6.40.0150.00714.25
5.6.30.0070.01414.40
5.6.20.0130.00613.99
5.6.10.0140.01014.35
5.6.00.0140.01114.17
5.5.380.0130.00414.07
5.5.370.0080.01214.26
5.5.360.0100.01014.22
5.5.350.0170.00214.24
5.5.340.0120.00914.32
5.5.330.0120.00713.80
5.5.320.0160.01314.18
5.5.310.0100.01314.24
5.5.300.0180.00714.31
5.5.290.0050.01614.15
5.5.280.0140.00714.06
5.5.270.0110.00714.28
5.5.260.0120.00814.47
5.5.250.0130.00614.16
5.5.240.0070.01413.91
5.5.230.0000.01914.00
5.5.220.0040.01814.34
5.5.210.0130.01314.23
5.5.200.0120.00914.24
5.5.190.0160.00414.53
5.5.180.0150.00514.23
5.5.170.0150.00414.28
5.5.160.0160.00514.07
5.5.150.0110.01214.41
5.5.140.0110.00914.40
5.5.130.0130.01214.09
5.5.120.0090.01514.13
5.5.110.0080.01414.37
5.5.100.0030.01814.09
5.5.90.0070.01113.96
5.5.80.0130.00614.24
5.5.70.0100.01314.01
5.5.60.0110.01114.49
5.5.50.0140.00714.40
5.5.40.0120.00814.20
5.5.30.0160.00514.23
5.5.20.0100.01014.09
5.5.10.0160.00714.16
5.5.00.0110.00813.86
5.4.450.0130.00311.34
5.4.440.0140.00311.34
5.4.430.0080.00811.34
5.4.420.0090.00611.34
5.4.410.0100.00311.34
5.4.400.0130.00411.34
5.4.390.0040.01211.34
5.4.380.0050.00911.34
5.4.370.0130.00311.34
5.4.360.0090.00611.34
5.4.350.0120.00311.34
5.4.340.0070.01011.34
5.4.330.0130.00311.34
5.4.320.0090.00911.34
5.4.310.0120.00411.34
5.4.300.0120.00411.34
5.4.290.0100.00711.34
5.4.280.0090.00611.34
5.4.270.0100.00711.34
5.4.260.0120.00311.34
5.4.250.0000.01211.34
5.4.240.0170.00011.34
5.4.230.0130.00311.34
5.4.220.0100.00511.34
5.4.210.0130.00011.34
5.4.200.0050.00911.34
5.4.190.0070.01011.34
5.4.180.0150.00311.34
5.4.170.0120.00611.34
5.4.160.0070.01011.34
5.4.150.0110.00011.34
5.4.140.0070.00711.34
5.4.130.0140.00311.34
5.4.120.0130.00311.34
5.4.110.0060.00611.34
5.4.100.0160.00011.34
5.4.90.0180.00011.34
5.4.80.0120.00611.34
5.4.70.0130.00311.34
5.4.60.0070.00711.34
5.4.50.0050.00711.34
5.4.40.0130.00011.34
5.4.30.0070.00711.34
5.4.20.0080.00811.34
5.4.10.0080.00811.34
5.4.00.0090.00711.34
5.3.290.0080.00811.34
5.3.280.0120.00311.34
5.3.270.0110.00411.34
5.3.260.0110.00411.34
5.3.250.0060.00611.34
5.3.240.0100.00311.34
5.3.230.0110.00411.34
5.3.220.0110.00411.34
5.3.210.0100.00311.34
5.3.200.0040.01211.34
5.3.190.0130.00011.34
5.3.180.0080.00411.34
5.3.170.0100.00311.34
5.3.160.0110.00011.34
5.3.150.0090.00611.34
5.3.140.0100.00711.34
5.3.130.0100.00311.34
5.3.120.0090.00711.34
5.3.110.0140.00011.34
5.3.100.0150.00011.34
5.3.90.0140.00011.34
5.3.80.0090.00911.34
5.3.70.0110.00011.34
5.3.60.0050.00911.34
5.3.50.0070.00711.34
5.3.40.0090.00311.34
5.3.30.0060.00611.34
5.3.20.0090.00511.34
5.3.10.0110.00211.34
5.3.00.0140.00011.34
5.2.170.0070.00411.34
5.2.160.0110.00011.34
5.2.150.0070.00411.34
5.2.140.0080.00211.34
5.2.130.0100.00311.34
5.2.120.0060.00311.34
5.2.110.0050.00511.34
5.2.100.0080.00411.34
5.2.90.0090.00211.34
5.2.80.0140.00011.34
5.2.70.0070.00411.34
5.2.60.0120.00011.34
5.2.50.0060.00611.34
5.2.40.0100.00011.34
5.2.30.0110.00011.34
5.2.20.0060.00611.34
5.2.10.0070.00211.34
5.2.00.0080.00611.34
5.1.60.0100.00011.34
5.1.50.0060.00311.34
5.1.40.0030.00711.34
5.1.30.0080.00411.34
5.1.20.0000.01111.34
5.1.10.0060.00611.34
5.1.00.0000.00911.34
5.0.50.0040.00411.34
5.0.40.0000.00611.34
5.0.30.0000.00711.34
5.0.20.0100.00011.34
5.0.10.0080.00011.34
5.0.00.0080.00011.34
4.4.90.0000.00711.34
4.4.80.0030.00311.34
4.4.70.0070.00011.34
4.4.60.0000.00611.34
4.4.50.0050.00311.34
4.4.40.0030.00311.34
4.4.30.0030.00311.34
4.4.20.0020.00511.34
4.4.10.0060.00011.34
4.4.00.0030.00311.34
4.3.110.0040.00211.34
4.3.100.0000.00911.34
4.3.90.0050.00211.34
4.3.80.0060.00011.34
4.3.70.0060.00011.34
4.3.60.0060.00011.34
4.3.50.0080.00011.34
4.3.40.0000.00511.34
4.3.30.0000.00411.34
4.3.20.0040.00011.34
4.3.10.0060.00011.34
4.3.00.0030.00311.34