3v4l.org

run code in 300+ PHP versions simultaneously
<?php $some_objects = [ new SomeClass(1), new SomeClass(2), new SomeClass(3), new SomeClass(4), ]; $func = function(SomeClass $x) { $x->some_function(); return $x; }; array_walk($some_objects, $func); var_dump($some_objects); $mangled_result = array_map($func, $some_objects); var_dump($mangled_result); class SomeClass { private $number; public function __construct($number) { $this->number = $number; } public function some_function() { try { throw new Exception(); } catch (Exception $e) { MANGLE_SOMEHOW($e->getTrace()); } } } function MANGLE_SOMEHOW($trace) { foreach ($trace as $i => $frame) { if (isset($frame['args'])) { foreach ($frame['args'] as $arg_index => $arg_value) { // And here I was thinking this was a 'copy'??? $frame['args'][$arg_index] = $arg_value; } } } } echo 'done';

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.3.70.0120.00316.75
8.3.60.0040.01116.63
8.3.50.0090.01122.97
8.3.40.0040.01118.68
8.3.30.0090.00619.01
8.3.20.0060.00320.05
8.3.10.0000.00823.44
8.3.00.0040.00419.50
8.2.180.0070.01416.38
8.2.170.0150.00622.96
8.2.160.0100.00320.38
8.2.150.0070.00024.18
8.2.140.0000.00824.66
8.2.130.0040.01126.16
8.2.120.0090.00021.16
8.2.110.0060.00322.14
8.2.100.0040.00817.84
8.2.90.0080.00019.17
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0060.00318.03
8.2.50.0030.00618.07
8.2.40.0000.00818.16
8.2.30.0040.00418.01
8.2.20.0030.00817.74
8.2.10.0080.00018.06
8.2.00.0030.00617.80
8.1.280.0110.00425.92
8.1.270.0030.00723.99
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0030.00623.92
8.1.230.0090.00319.02
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0090.00317.36
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0050.00318.59
8.1.160.0030.00622.04
8.1.150.0040.00418.80
8.1.140.0040.00417.38
8.1.130.0000.00717.84
8.1.120.0040.00417.48
8.1.110.0080.00017.47
8.1.100.0040.00417.36
8.1.90.0030.00617.55
8.1.80.0020.00517.34
8.1.70.0040.00417.37
8.1.60.0080.00017.55
8.1.50.0000.00817.54
8.1.40.0000.00817.45
8.1.30.0080.00017.58
8.1.20.0050.00217.56
8.1.10.0040.00417.57
8.1.00.0050.00217.46
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0000.00718.45
8.0.270.0000.00817.32
8.0.260.0030.00317.27
8.0.250.0000.00717.04
8.0.240.0040.00716.91
8.0.230.0050.00316.86
8.0.220.0040.00416.84
8.0.210.0050.00316.88
8.0.200.0000.00716.92
8.0.190.0030.00617.05
8.0.180.0000.00816.91
8.0.170.0040.00417.00
8.0.160.0050.00317.03
8.0.150.0050.00216.89
8.0.140.0040.00416.82
8.0.130.0050.00013.48
8.0.120.0050.00316.83
8.0.110.0050.00317.02
8.0.100.0040.00416.98
8.0.90.0030.00516.83
8.0.80.0180.00416.92
8.0.70.0040.00416.92
8.0.60.0000.00817.02
8.0.50.0050.00216.96
8.0.30.0170.00317.26
8.0.20.0070.01317.40
8.0.10.0000.00716.99
8.0.00.0050.01316.78
7.4.330.0050.00015.14
7.4.320.0030.00316.53
7.4.300.0030.00316.60
7.4.290.0030.00316.42
7.4.280.0030.00616.64
7.4.270.0090.00016.62
7.4.260.0030.00416.46
7.4.250.0030.00516.62
7.4.240.0040.00416.52
7.4.230.0000.00716.34
7.4.220.0030.01516.64
7.4.210.0060.00816.61
7.4.200.0070.00016.65
7.4.160.0040.01716.59
7.4.150.0060.01317.40
7.4.140.0290.02617.86
7.4.130.0070.01016.54
7.4.120.0060.01016.51
7.4.110.0150.00916.40
7.4.100.0030.01416.70
7.4.90.0090.01816.60
7.4.80.0030.01319.39
7.4.70.0140.00616.60
7.4.60.0030.01316.57
7.4.50.0000.00916.28
7.4.40.0130.00316.23
7.4.30.0140.00416.38
7.4.00.0090.00515.05
7.3.330.0070.00013.22
7.3.320.0030.00513.38
7.3.310.0000.00716.45
7.3.300.0050.00316.44
7.3.290.0090.00916.49
7.3.280.0110.00616.43
7.3.270.0120.00617.40
7.3.260.0160.00316.42
7.3.250.0070.01016.42
7.3.240.0120.00616.48
7.3.230.0130.00316.41
7.3.210.0140.00416.43
7.3.200.0090.00919.39
7.3.190.0150.00316.32
7.3.180.0090.00616.51
7.3.170.0090.00916.40
7.3.160.0100.00616.59
7.3.120.0120.00615.03
7.3.110.0040.01515.04
7.3.100.0030.00914.57
7.3.90.0060.00314.86
7.3.80.0080.00815.11
7.3.70.0120.00414.95
7.3.60.0040.01114.73
7.3.50.0000.01514.87
7.3.40.0060.00614.75
7.3.30.0000.00914.68
7.3.20.0070.00716.73
7.3.10.0090.00616.72
7.3.00.0040.00416.68
7.2.330.0090.00916.76
7.2.320.0090.00916.84
7.2.310.0000.01816.80
7.2.300.0090.01016.80
7.2.290.0130.00316.79
7.2.250.0120.00615.28
7.2.240.0140.00715.23
7.2.230.0000.01515.27
7.2.220.0030.00914.81
7.2.210.0070.01115.08
7.2.200.0030.00715.20
7.2.190.0040.01115.12
7.2.180.0070.00715.11
7.2.170.0070.00415.18
7.2.00.0060.01019.33
7.1.330.0030.01215.74
7.1.320.0060.00615.78
7.1.310.0060.00316.02
7.1.300.0120.00415.77
7.1.290.0140.00015.80
7.1.280.0080.00715.74
7.1.270.0050.00515.86
7.1.260.0030.00715.91
7.1.100.0000.01317.86
7.1.70.0080.00317.35
7.1.60.0060.00619.40
7.1.50.0070.01817.02
7.0.200.0000.00916.68
5.4.450.0300.07319.46
5.4.440.0200.07719.48
5.4.430.1970.05019.56
5.4.420.3900.03319.54
5.4.410.3800.04019.18
5.4.400.4470.03318.93
5.4.390.0230.04319.18
5.4.380.0330.07019.13
5.4.370.0270.05019.13
5.4.360.0300.07319.15
5.4.350.0370.06719.21
5.4.340.0170.05719.18
5.4.320.0230.06019.18
5.4.310.0300.04719.15
5.4.300.0370.06018.93
5.4.290.0330.05719.12
5.4.280.0270.03318.98
5.4.270.0270.03319.14
5.4.260.0200.03719.21
5.4.250.0270.03019.10
5.4.240.0200.03718.93
5.4.230.0230.04319.14
5.4.220.0230.07019.12
5.4.210.0200.04319.11
5.4.200.0170.04019.20
5.4.190.0200.04019.13
5.4.180.0200.03719.08
5.4.170.0200.03719.14
5.4.160.0330.03318.95
5.4.150.0200.03718.91
5.4.140.0200.04316.54
5.4.130.0170.03716.41
5.4.120.0200.03716.44
5.4.110.0200.03316.27
5.4.100.0300.03016.27
5.4.90.0170.03716.43
5.4.80.0170.03716.54
5.4.70.0230.03016.19
5.4.60.0170.03716.40
5.4.50.0230.04016.41
5.4.40.0170.03716.52
5.4.30.0232.47316.52
5.4.20.0232.47316.50
5.4.10.0372.46016.19
5.4.00.0302.46715.79

preferences:
36.46 ms | 401 KiB | 5 Q