3v4l.org

run code in 300+ 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; } }

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)
8.4.20.0160.00318.71
8.4.10.0030.01317.92
8.3.150.0040.00416.55
8.3.140.0060.00316.63
8.3.130.0030.00618.56
8.3.120.0060.00318.90
8.3.110.0030.00620.94
8.3.100.0030.01416.74
8.3.90.0030.01618.79
8.3.80.0030.00718.43
8.3.70.0090.00618.64
8.3.60.0110.00718.68
8.3.50.0150.00322.09
8.3.40.0150.00618.84
8.3.30.0110.00418.48
8.3.20.0040.00421.73
8.3.10.0090.00620.16
8.3.00.0080.00023.42
8.2.260.0060.00917.16
8.2.250.0070.00416.75
8.2.240.0100.01017.23
8.2.230.0030.00622.58
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0110.00016.48
8.2.190.0040.01118.29
8.2.180.0280.00316.50
8.2.170.0040.01122.96
8.2.160.0070.00721.20
8.2.150.0030.00724.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00418.97
8.2.110.0060.00320.98
8.2.100.0000.01117.97
8.2.90.0080.00018.03
8.2.80.0000.00817.97
8.2.70.0040.00417.93
8.2.60.0040.00418.16
8.2.50.0060.00318.10
8.2.40.0000.00719.52
8.2.30.0080.00019.36
8.2.20.0000.00718.13
8.2.10.0040.00419.42
8.2.00.0030.00319.21
8.1.310.0150.00418.16
8.1.300.0030.00618.07
8.1.290.0030.00618.88
8.1.280.0100.01025.92
8.1.270.0090.00022.45
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0040.00422.06
8.1.230.0070.00422.73
8.1.220.0080.00017.76
8.1.210.0060.00318.91
8.1.200.0130.00017.23
8.1.190.0090.00017.35
8.1.180.0000.00818.10
8.1.170.0000.00818.61
8.1.160.0070.00018.96
8.1.150.0040.00418.96
8.1.140.0070.00022.19
8.1.130.0000.00720.15
8.1.120.0070.00017.47
8.1.110.0000.00717.47
8.1.100.0000.00917.47
8.1.90.0000.00917.34
8.1.80.0090.00017.45
8.1.70.0030.00317.43
8.1.60.0000.00817.60
8.1.50.0000.00917.49
8.1.40.0000.01017.50
8.1.30.0080.00417.64
8.1.20.0000.01017.71
8.1.10.0090.00017.46
8.1.00.0000.00817.55
8.0.300.0040.00421.91
8.0.290.0070.00016.63
8.0.280.0000.00718.48
8.0.270.0000.00717.25
8.0.260.0040.00420.07
8.0.250.0000.00916.95
8.0.240.0080.00016.99
8.0.230.0000.00716.91
8.0.220.0030.00316.96
8.0.210.0070.00016.90
8.0.200.0030.00516.88
8.0.190.0000.00916.90
8.0.180.0040.00416.96
8.0.170.0040.00416.86
8.0.160.0050.00216.92
8.0.150.0040.00416.88
8.0.140.0070.00016.91
8.0.130.0060.00013.41
8.0.120.0000.00716.88
8.0.110.0040.00416.94
8.0.100.0000.00816.82
8.0.90.0030.00616.82
8.0.80.0090.00916.93
8.0.70.0040.00416.97
8.0.60.0040.00416.75
8.0.50.0000.00716.91
8.0.30.0100.00617.23
8.0.20.0120.01217.34
8.0.10.0000.00717.01
8.0.00.0060.01316.81
7.4.330.0000.00515.55
7.4.320.0070.00016.48
7.4.300.0000.00716.58
7.4.290.0040.00416.44
7.4.280.0000.00716.48
7.4.270.0030.00316.52
7.4.260.0070.00016.58
7.4.250.0040.00416.51
7.4.240.0020.00616.51
7.4.230.0030.00316.53
7.4.220.0030.00416.46
7.4.210.0090.00516.61
7.4.200.0030.00416.39
7.4.140.0050.01317.86
7.4.130.0120.00616.41
7.4.120.0090.01416.52
7.4.110.0080.01016.55
7.4.100.0000.02316.60
7.4.90.0100.00916.43
7.4.80.0160.00319.39
7.4.70.0090.01216.60
7.4.60.0070.01016.50
7.4.50.0040.01116.36
7.4.40.0090.00916.68
7.4.00.0000.01415.07
7.3.330.0060.00013.21
7.3.320.0000.00513.45
7.3.310.0040.00416.23
7.3.300.0000.00716.29
7.3.290.0030.01116.44
7.3.280.0070.00916.39
7.3.260.0110.00916.51
7.3.230.0130.00316.37
7.3.210.0080.00916.48
7.3.200.0100.00716.45
7.3.190.0150.00416.34
7.3.180.0060.01216.39
7.3.170.0120.00916.50
7.3.160.0160.00016.45
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.330.0180.00016.73
7.2.320.0040.01316.80
7.2.310.0110.00716.68
7.2.300.0060.01916.81
7.2.290.0070.01016.73
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

preferences:
81.63 ms | 403 KiB | 5 Q