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()); call_user_func($callback); try { $callback(); } catch( Error $e ) { echo $e->getMessage(), PHP_EOL; } }
based on VfmVa

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.60.0100.00616.62
7.4.50.0080.00816.39
7.4.10.0070.01114.97
7.4.00.0080.00714.89
7.3.180.0060.01016.37
7.3.130.0160.00315.01
7.3.120.0060.01214.98
7.3.110.0040.01514.76
7.3.100.0150.00014.94
7.3.90.0030.01714.87
7.3.80.0120.00015.03
7.3.70.0080.00714.65
7.3.60.0070.00814.69
7.3.50.0080.00514.64
7.3.40.0080.00514.83
7.3.30.0110.00214.60
7.3.20.0070.00815.78
7.3.10.0100.00615.74
7.3.00.0040.01315.73
7.2.260.0060.01214.98
7.2.250.0110.00714.99
7.2.240.0000.01415.39
7.2.230.0030.01714.91
7.2.220.0030.01215.22
7.2.210.0070.00715.22
7.2.200.0080.00614.94
7.2.190.0090.00515.03
7.2.180.0070.00614.81
7.2.170.0090.00715.02
7.2.160.0090.00615.12
7.2.150.0080.00615.79
7.2.140.0300.00515.79
7.2.130.0070.00515.87
7.2.120.0080.00816.04
7.2.110.0100.00616.10
7.2.100.0120.00516.07
7.2.90.0070.01016.07
7.2.80.0070.00916.08
7.2.70.0100.00715.93
7.2.60.0050.01115.92
7.2.50.0120.00616.06
7.2.40.0060.01216.02
7.2.30.0050.01315.85
7.2.20.0230.00716.13
7.2.10.0140.00515.97
7.2.00.0080.00815.88
7.1.330.0000.01415.77
7.1.320.0000.01915.73
7.1.310.0000.01415.98
7.1.300.0090.00814.90
7.1.290.0050.00914.71
7.1.280.0110.00514.80
7.1.270.0040.01314.67
7.1.260.0090.00814.72
7.1.250.0090.00414.84
7.1.240.0090.00814.99
7.1.230.0180.00214.68
7.1.220.0110.00814.82
7.1.210.0070.01314.72
7.1.200.0080.00814.95
7.1.190.0090.00814.96
7.1.180.0050.01214.51
7.1.170.0100.00814.78
7.1.160.0050.01214.68
7.1.150.0120.00514.94
7.1.140.0140.00514.96
7.1.130.0100.00714.79
7.1.120.0060.01114.99
7.1.110.0170.00414.77
7.1.100.0120.00614.67
7.1.90.0110.00814.76
7.1.80.0090.00714.79
7.1.70.0030.00914.60
7.1.60.0090.00614.57
7.1.50.0110.00714.65
7.1.40.0070.01114.87
7.1.30.0090.01114.78
7.1.20.0090.00714.89
7.1.10.0100.00714.86
7.1.00.0120.00714.65
7.0.330.0210.00313.80
7.0.320.0240.00013.74
7.0.310.0230.00013.34
7.0.300.0130.01013.43
7.0.290.0230.00413.80
7.0.280.0150.00513.65
7.0.270.0140.01013.67
7.0.260.0200.00313.59
7.0.250.0150.00713.85
7.0.240.0110.01113.58
7.0.230.0170.00413.54
7.0.220.0220.01013.76
7.0.210.0140.00613.62
7.0.200.0170.00913.59
7.0.190.0130.01013.66
7.0.180.0090.01213.47
7.0.170.0190.00513.57
7.0.160.0150.01113.50
7.0.150.0180.00913.72
7.0.140.0450.00813.70
7.0.130.0180.00813.55
7.0.120.0100.01013.66
7.0.110.0090.01313.57
7.0.100.0160.00613.34
7.0.90.0150.01213.53
7.0.80.0170.00613.56
7.0.70.0200.00713.46
7.0.60.0190.00613.54
7.0.50.0170.00613.67
7.0.40.0190.00613.80
7.0.30.0140.00513.61
7.0.20.0130.01013.66
7.0.10.0230.00313.47
7.0.00.0130.01213.69
5.6.400.0130.00913.86
5.6.390.0080.01114.42
5.6.380.0200.00013.82
5.6.370.0160.00414.37
5.6.360.0180.00414.36
5.6.350.0100.01314.29
5.6.340.0130.01014.35
5.6.330.0190.00314.38
5.6.320.0100.01014.26
5.6.310.0160.00514.34
5.6.300.0110.01114.37
5.6.290.0150.00714.44
5.6.280.0140.00814.43
5.6.270.0000.02014.14
5.6.260.0130.00714.26
5.6.250.0150.00814.04
5.6.240.0140.00914.54
5.6.230.0200.00314.18
5.6.220.0120.01114.13
5.6.210.0070.01414.14
5.6.200.0110.01114.46
5.6.190.0180.00314.27
5.6.180.0080.01714.25
5.6.170.0180.00414.03
5.6.160.0060.01314.23
5.6.150.0160.00413.87
5.6.140.0210.00014.43
5.6.130.0200.00314.58
5.6.120.0080.01614.17
5.6.110.0070.01714.12
5.6.100.0170.00614.49
5.6.90.0140.00814.49
5.6.80.0090.01313.88
5.6.70.0180.00714.23
5.6.60.0190.00214.13
5.6.50.0070.01414.17
5.6.40.0080.01214.23
5.6.30.0090.01113.95
5.6.20.0180.00414.15
5.6.10.0070.01414.20
5.6.00.0190.00414.11
5.5.380.0110.01114.15
5.5.370.0160.00614.21
5.5.360.0230.00014.13
5.5.350.0120.00914.25
5.5.340.0170.00614.00
5.5.330.0210.00314.32
5.5.320.0140.00914.45
5.5.310.0060.01314.16
5.5.300.0200.00314.39
5.5.290.0120.00514.11
5.5.280.0170.00414.36
5.5.270.0200.00414.20
5.5.260.0110.01114.20
5.5.250.0110.00814.32
5.5.240.0110.01114.32
5.5.230.0130.00413.89
5.5.220.0060.01514.23
5.5.210.0170.00313.92
5.5.200.0160.00713.85
5.5.190.0000.02414.01
5.5.180.0160.00613.95
5.5.170.0130.00414.24
5.5.160.0060.01713.80
5.5.150.0050.01513.79
5.5.140.0110.00814.26
5.5.130.0160.00414.23
5.5.120.0100.01214.21
5.5.110.0190.00314.43
5.5.100.0150.00714.33
5.5.90.0150.00714.36
5.5.80.0070.01414.22
5.5.70.0130.00814.49
5.5.60.0150.00314.30
5.5.50.0050.01414.03
5.5.40.0180.00314.33
5.5.30.0140.00714.27
5.5.20.0110.00814.20
5.5.10.0130.00814.05
5.5.00.0210.00014.08
5.4.450.0090.00511.34
5.4.440.0090.00911.34
5.4.430.0140.00211.34
5.4.420.0080.01111.34
5.4.410.0070.00911.34
5.4.400.0080.01011.34
5.4.390.0100.00711.34
5.4.380.0120.00311.34
5.4.370.0080.00611.34
5.4.360.0140.00311.34
5.4.350.0070.01011.34
5.4.340.0120.00011.34
5.4.330.0110.00311.34
5.4.320.0060.00811.34
5.4.310.0110.00311.34
5.4.300.0140.00511.34
5.4.290.0130.00011.34
5.4.280.0060.01211.34
5.4.270.0100.00511.34
5.4.260.0080.00611.34
5.4.250.0090.00511.34
5.4.240.0100.00511.34
5.4.230.0060.01011.34
5.4.220.0120.00411.34
5.4.210.0060.00911.34
5.4.200.0160.00011.34
5.4.190.0150.00011.34
5.4.180.0070.00711.34
5.4.170.0050.01011.34
5.4.160.0050.00711.34
5.4.150.0040.00911.34
5.4.140.0100.00511.34
5.4.130.0090.00911.34
5.4.120.0110.00511.34
5.4.110.0130.00311.34
5.4.100.0070.01111.34
5.4.90.0050.01011.34
5.4.80.0070.01011.34
5.4.70.0110.00711.34
5.4.60.0060.00611.34
5.4.50.0060.00611.34
5.4.40.0100.00311.34
5.4.30.0090.00411.34
5.4.20.0070.00711.34
5.4.10.0100.00511.34
5.4.00.0000.01611.34
5.3.290.0040.01111.34
5.3.280.0070.00411.34
5.3.270.0050.01011.34
5.3.260.0140.00011.34
5.3.250.0030.00911.34
5.3.240.0110.00011.34
5.3.230.0090.00611.34
5.3.220.0070.00711.34
5.3.210.0090.00611.34
5.3.200.0100.00311.34
5.3.190.0140.00411.34
5.3.180.0120.00011.34
5.3.170.0070.00411.34
5.3.160.0060.00611.34
5.3.150.0090.00311.34
5.3.140.0170.00011.34
5.3.130.0140.00311.34
5.3.120.0080.00611.34
5.3.110.0130.00011.34
5.3.100.0060.00811.34
5.3.90.0110.00011.34
5.3.80.0000.01111.34
5.3.70.0080.00311.34
5.3.60.0120.00211.34
5.3.50.0090.00511.34
5.3.40.0070.00711.34
5.3.30.0070.00711.34
5.3.20.0090.00411.34
5.3.10.0080.00511.34
5.3.00.0120.00411.34
5.2.170.0000.00911.34
5.2.160.0100.00311.34
5.2.150.0100.00311.34
5.2.140.0060.00511.34
5.2.130.0100.00011.34
5.2.120.0090.00211.34
5.2.110.0130.00011.34
5.2.100.0000.01011.34
5.2.90.0070.00711.34
5.2.80.0030.00911.34
5.2.70.0070.00311.34
5.2.60.0040.00411.34
5.2.50.0070.00511.34
5.2.40.0000.00911.34
5.2.30.0040.00711.34
5.2.20.0050.00511.34
5.2.10.0040.00811.34
5.2.00.0130.00011.34
5.1.60.0020.00511.34
5.1.50.0040.00611.34
5.1.40.0050.00511.34
5.1.30.0060.00311.34
5.1.20.0060.00611.34
5.1.10.0040.00411.34
5.1.00.0040.00411.34
5.0.50.0000.00711.34
5.0.40.0050.00211.34
5.0.30.0000.00911.34
5.0.20.0050.00311.34
5.0.10.0030.00311.34
5.0.00.0070.00011.34
4.4.90.0050.00211.34
4.4.80.0000.00511.34
4.4.70.0070.00211.34
4.4.60.0060.00311.34
4.4.50.0000.01011.34
4.4.40.0030.00311.34
4.4.30.0030.00311.34
4.4.20.0030.00311.34
4.4.10.0020.00411.34
4.4.00.0030.00311.34
4.3.110.0070.00011.34
4.3.100.0040.00411.34
4.3.90.0000.00711.34
4.3.80.0040.00411.34
4.3.70.0050.00311.34
4.3.60.0040.00411.34
4.3.50.0000.00811.34
4.3.40.0080.00011.34
4.3.30.0070.00011.34
4.3.20.0000.00711.34
4.3.10.0060.00011.34
4.3.00.0030.00311.34