3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $val; public function __construct($val) { $this->val = $val; } } $storage = new SplObjectStorage; for($i = 1; $i <= 10; $i++) { $storage->attach(new A($i)); } $iterations = 0; $storage->rewind(); while ($storage->valid()) { $iterations++; $object = $storage->current(); echo 'Iteration #' . $iterations . ' with object A(' . $object->val . ')'; $storage->next(); if($iterations === 2 || $iterations === 8) { $storage->detach($object); echo ' - deleted Object A(' . $object->val . ') '; } echo PHP_EOL; } echo 'Number of iterations: ' . $iterations . 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.3.60.0100.01016.50
8.3.50.0230.00322.11
8.3.40.0110.00718.80
8.3.30.0070.01119.07
8.3.20.0050.00320.34
8.3.10.0080.00023.48
8.3.00.0030.00520.87
8.2.180.0140.00416.50
8.2.170.0100.01022.96
8.2.160.0080.00620.53
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.36
8.2.110.0000.00921.18
8.2.100.0070.00417.84
8.2.90.0000.01018.09
8.2.80.0060.00318.80
8.2.70.0100.00017.59
8.2.60.0080.00019.23
8.2.50.0080.00017.50
8.2.40.0000.00819.35
8.2.30.0000.00718.13
8.2.20.0000.00817.56
8.2.10.0000.00818.14
8.2.00.0050.00317.67
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0070.00320.92
8.1.230.0040.00819.29
8.1.220.0050.00517.77
8.1.210.0030.00518.77
8.1.200.0060.00317.11
8.1.190.0040.00417.35
8.1.180.0080.00019.01
8.1.170.0040.00419.01
8.1.160.0030.00522.02
8.1.150.0000.01018.57
8.1.140.0030.00617.30
8.1.130.0070.00017.75
8.1.120.0030.00317.50
8.1.110.0030.00517.46
8.1.100.0000.00717.46
8.1.90.0000.00717.46
8.1.80.0080.00017.37
8.1.70.0000.00717.41
8.1.60.0050.00317.65
8.1.50.0080.00017.54
8.1.40.0090.00317.50
8.1.30.0060.00317.65
8.1.20.0000.00817.57
8.1.10.0000.00717.63
8.1.00.0030.00517.51
8.0.300.0070.00018.77
8.0.290.0000.00816.75
8.0.280.0030.00318.50
8.0.270.0030.00317.17
8.0.260.0060.00017.27
8.0.250.0030.00317.01
8.0.240.0100.00016.90
8.0.230.0070.00016.93
8.0.220.0030.00316.82
8.0.210.0030.00516.79
8.0.200.0000.00916.96
8.0.190.0070.00016.88
8.0.180.0000.00716.82
8.0.170.0040.00416.98
8.0.160.0000.00716.92
8.0.150.0030.00516.73
8.0.140.0000.00716.87
8.0.130.0030.00313.33
8.0.120.0050.00316.82
8.0.110.0060.00316.79
8.0.100.0040.00416.90
8.0.90.0070.00016.85
8.0.80.0060.00916.94
8.0.70.0030.00516.75
8.0.60.0000.00716.90
8.0.50.0030.00516.70
8.0.30.0120.00617.04
8.0.20.0100.00917.40
8.0.10.0030.00517.08
8.0.00.0060.01116.70
7.4.330.0000.00515.08
7.4.320.0060.00016.50
7.4.300.0030.00516.50
7.4.290.0000.00716.63
7.4.280.0050.00316.61
7.4.270.0070.00016.42
7.4.260.0030.00516.57
7.4.250.0040.00416.55
7.4.240.0000.00716.58
7.4.230.0000.00716.43
7.4.220.0090.00916.65
7.4.210.0070.01116.51
7.4.200.0040.00416.41
7.4.160.0070.01016.43
7.4.150.0060.01217.40
7.4.140.0150.00517.86
7.4.130.0080.01016.52
7.4.120.0080.00916.52
7.4.110.0070.01116.41
7.4.100.0000.01716.44
7.4.90.0000.01916.63
7.4.80.0120.00919.39
7.4.70.0140.00316.46
7.4.60.0110.00516.55
7.4.50.0000.00416.30
7.4.40.0160.00016.63
7.4.30.0130.00316.38
7.4.00.0030.01314.82
7.3.330.0050.00013.38
7.3.320.0030.00313.15
7.3.310.0000.00816.25
7.3.300.0000.00716.36
7.3.290.0070.00716.32
7.3.280.0090.00716.33
7.3.270.0060.01117.40
7.3.260.0140.00316.27
7.3.250.0080.01216.48
7.3.240.0130.00716.63
7.3.230.0140.00316.39
7.3.210.0120.00916.66
7.3.200.0000.01519.39
7.3.190.0070.01116.51
7.3.180.0040.01116.40
7.3.170.0070.01016.50
7.3.160.0090.00816.36
7.3.120.0060.01214.93
7.2.330.0150.00716.39
7.2.320.0100.01116.89
7.2.310.0100.01416.84
7.2.300.0080.00816.46
7.2.290.0120.00616.87
7.2.60.0070.00716.90
7.1.200.0080.00415.76
7.1.70.0070.01017.00
7.1.60.0070.01019.70
7.1.50.0070.01816.98
7.1.00.0070.07322.31
7.0.200.0070.00016.82
7.0.140.0070.06721.91
7.0.60.0030.04019.94
7.0.50.0170.06717.88
7.0.40.0100.07017.73
7.0.30.0100.08717.77
7.0.20.0070.06017.74
7.0.10.0100.07317.85
7.0.00.0000.04717.68
5.6.210.0030.06020.73
5.6.200.0070.09018.18
5.6.190.0100.07318.29
5.6.180.0070.08018.18
5.6.170.0100.07318.15
5.6.160.0030.04018.23
5.6.150.0100.08318.12
5.6.140.0100.07718.15
5.6.130.0070.07018.15
5.6.120.0100.07718.28
5.6.110.0070.04318.26
5.6.100.0000.09018.17
5.6.90.0030.08018.10
5.6.80.0030.05717.61
5.6.70.0030.04717.56
5.6.60.0100.05717.53
5.6.50.0170.07017.58
5.6.40.0030.08017.47
5.6.30.0030.06017.52
5.6.20.0000.04317.59
5.6.10.0070.03717.52
5.6.00.0100.07317.65
5.5.350.0030.06320.53
5.5.340.0000.09017.96
5.5.330.0100.08017.98
5.5.320.0070.08317.96
5.5.310.0030.05318.03
5.5.300.0100.07317.97
5.5.290.0000.08717.95
5.5.280.0100.07717.97
5.5.270.0130.03718.07
5.5.260.0100.03717.96
5.5.250.0030.08317.89
5.5.240.0030.04017.45
5.5.230.0070.08017.30
5.5.220.0030.07017.44
5.5.210.0130.07317.36
5.5.200.0170.07017.27
5.5.190.0130.04017.29
5.5.180.0100.07317.44
5.5.160.0070.05317.30
5.5.150.0100.07717.39
5.5.140.0100.07717.33
5.5.130.0070.07717.43
5.5.120.0070.06717.43
5.5.110.0070.08017.30
5.5.100.0070.07717.27
5.5.90.0030.05717.28
5.5.80.0130.05317.33
5.5.70.0070.08017.22
5.5.60.0100.07017.32
5.5.50.0030.07717.20
5.5.40.0030.07717.16
5.5.30.0130.06317.19
5.5.20.0030.07317.18
5.5.10.0030.07717.23
5.5.00.0070.04317.17
5.4.450.0170.07019.42
5.4.440.0230.06719.38
5.4.430.0000.09019.35
5.4.420.0130.03719.59
5.4.410.0100.04019.15
5.4.400.0100.05318.98
5.4.390.0070.08019.05
5.4.380.0070.07319.00
5.4.370.0000.04719.03
5.4.360.0130.07018.89
5.4.350.0030.07319.09
5.4.340.0070.06019.01
5.4.320.0030.05719.27
5.4.310.0100.07719.04
5.4.300.0130.07019.30
5.4.290.0100.05019.05
5.4.280.0100.04318.95
5.4.270.0070.07319.00
5.4.260.0000.08719.09
5.4.250.0100.07019.13
5.4.240.0100.07319.04
5.4.230.0000.04719.05
5.4.220.0170.06319.05
5.4.210.0070.06319.13
5.4.200.0070.06718.97
5.4.190.0100.07319.00
5.4.180.0070.07019.08
5.4.170.0030.04719.02
5.4.160.0100.03719.07
5.4.150.0100.07018.87
5.4.140.0100.07716.36
5.4.130.0070.07016.32
5.4.120.0130.07316.40
5.4.110.0070.07316.37
5.4.100.0100.07316.33
5.4.90.0030.07316.48
5.4.80.0030.07316.47
5.4.70.0070.06716.29
5.4.60.0070.07016.30
5.4.50.0200.05316.34
5.4.40.0070.06316.48
5.4.30.0070.07016.21
5.4.20.0070.04716.41
5.4.10.0100.04716.33
5.4.00.0000.08015.83
5.3.290.0030.07314.72
5.3.280.0100.05314.71
5.3.270.0030.05314.46
5.3.260.0000.04314.82
5.3.250.0030.03714.56
5.3.240.0100.07314.68
5.3.230.0000.06014.58
5.3.220.0100.04314.78
5.3.210.0070.08014.60
5.3.200.0030.06314.57
5.3.190.0130.06314.52
5.3.180.0000.08014.56
5.3.170.0030.06314.63
5.3.160.0030.07714.78
5.3.150.0100.07314.57
5.3.140.0100.07014.62
5.3.130.0070.07714.57
5.3.120.0000.08314.58
5.3.110.0030.07314.57
5.3.100.0070.07314.04
5.3.90.0070.06013.97
5.3.80.0000.08314.05
5.3.70.0070.04314.04
5.3.60.0070.03014.07
5.3.50.0030.03713.98
5.3.40.0000.04313.96
5.3.30.0030.03313.94
5.3.20.0000.03713.60
5.3.10.0030.03313.50
5.3.00.0030.03313.67
5.2.170.0000.03311.14
5.2.160.0030.02711.11
5.2.150.0000.03311.15
5.2.140.0030.02711.18
5.2.130.0000.03011.00
5.2.120.0000.03011.14
5.2.110.0030.02711.20
5.2.100.0030.02711.00
5.2.90.0030.02711.20
5.2.80.0000.03011.30
5.2.70.0030.03310.94
5.2.60.0030.02711.15
5.2.50.0030.02711.07
5.2.40.0000.03011.07
5.2.30.0030.02710.82
5.2.20.0000.03010.92
5.2.10.0030.02710.95
5.2.00.0000.03010.77
5.1.60.0030.0239.99
5.1.50.0030.02310.00
5.1.40.0030.02310.05
5.1.30.0030.02310.32
5.1.20.0000.03010.40
5.1.10.0000.0279.90
5.1.00.0000.03010.05
5.0.50.0030.0208.86
5.0.40.0030.0178.86
5.0.30.0000.0308.86
5.0.20.0030.0178.86
5.0.10.0030.0178.86
5.0.00.0030.0278.86
4.4.90.0000.0138.86
4.4.80.0000.0178.86
4.4.70.0030.0138.86
4.4.60.0000.0178.86
4.4.50.0000.0138.86
4.4.40.0030.0208.86
4.4.30.0030.0138.86
4.4.20.0000.0178.86
4.4.10.0030.0138.86
4.4.00.0000.0278.86
4.3.110.0000.0138.86
4.3.100.0000.0138.86
4.3.90.0000.0138.86
4.3.80.0000.0238.86
4.3.70.0000.0138.86
4.3.60.0000.0138.86
4.3.50.0000.0138.86
4.3.40.0030.0208.86
4.3.30.0000.0178.86
4.3.20.0000.0178.86
4.3.10.0000.0178.86
4.3.00.0030.0308.86

preferences:
33.7 ms | 401 KiB | 5 Q