3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $val; public function __construct($val) { $this->val = $val; } } $storage = new SplObjectStorage; $storage->attach(new A(1)); $storage->attach(new A(2)); $storage->attach(new A(3)); $storage->attach(new A(4)); $storage->attach(new A(5)); $storage->attach(new A(6)); $storage->attach(new A(7)); $storage->attach(new A(8)); $storage->attach(new A(9)); $storage->attach(new A(10)); $storage->rewind(); $iterations = 0; $expected = count($storage); while ($storage->valid()) { $iterations++; $object = $storage->current(); echo 'Iteration #' . $iterations . ' with object A(' . $object->val . ')'; $storage->next(); if($iterations === 2 || $iterations === 8) { echo ' - deleted Object A(' . $object->val . ') ' . PHP_EOL; $storage->detach($object); continue; } echo PHP_EOL; } if(count($storage) != $iterations) { echo 'Error!' . PHP_EOL; } else { echo 'Success!' . PHP_EOL; } exit;

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.0070.01418.31
8.3.50.0230.00722.11
8.3.40.0110.00418.84
8.3.30.0070.00718.87
8.3.20.0070.01018.57
8.3.10.0080.00020.92
8.3.00.0050.00221.90
8.2.180.0160.00718.29
8.2.170.0070.00722.96
8.2.160.0100.00322.31
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0110.00720.79
8.2.110.0080.00020.39
8.2.100.0090.00318.03
8.2.90.0080.00019.26
8.2.80.0000.00917.97
8.2.70.0030.00617.63
8.2.60.0030.00617.93
8.2.50.0060.00318.07
8.2.40.0050.00218.34
8.2.30.0050.00319.89
8.2.20.0000.00817.67
8.2.10.0000.00817.69
8.2.00.0000.01017.87
8.1.280.0110.00325.92
8.1.270.0040.00423.99
8.1.260.0110.00426.35
8.1.250.0050.00228.09
8.1.240.0060.00322.05
8.1.230.0060.00617.42
8.1.220.0040.00417.74
8.1.210.0070.00318.77
8.1.200.0030.00617.35
8.1.190.0040.00417.51
8.1.180.0040.00418.10
8.1.170.0080.00018.51
8.1.160.0050.00218.98
8.1.150.0040.00418.55
8.1.140.0050.00217.40
8.1.130.0000.00717.79
8.1.120.0000.00717.54
8.1.110.0050.00317.46
8.1.100.0040.00417.50
8.1.90.0040.00417.47
8.1.80.0080.00017.45
8.1.70.0080.00017.36
8.1.60.0040.00417.65
8.1.50.0070.00017.43
8.1.40.0040.00417.55
8.1.30.0040.00417.68
8.1.20.0090.00017.70
8.1.10.0000.00717.62
8.1.00.0000.00817.54
8.0.300.0000.00818.77
8.0.290.0060.00316.75
8.0.280.0000.00718.40
8.0.270.0000.00717.20
8.0.260.0030.00316.93
8.0.250.0070.00017.06
8.0.240.0060.00317.08
8.0.230.0030.00317.00
8.0.220.0040.00416.93
8.0.210.0040.00416.96
8.0.200.0070.00016.92
8.0.190.0030.00616.99
8.0.180.0040.00417.04
8.0.170.0030.00617.02
8.0.160.0040.00417.11
8.0.150.0080.00016.88
8.0.140.0030.00616.79
8.0.130.0030.00313.46
8.0.120.0040.00416.97
8.0.110.0040.00417.00
8.0.100.0000.00716.93
8.0.90.0000.00816.88
8.0.80.0060.00916.98
8.0.70.0040.00416.86
8.0.60.0050.00317.06
8.0.50.0000.00716.84
8.0.30.0140.00617.27
8.0.20.0090.01017.41
8.0.10.0040.00416.95
8.0.00.0120.00716.70
7.4.330.0050.00014.80
7.4.320.0030.00316.64
7.4.300.0030.00316.53
7.4.290.0070.00016.64
7.4.280.0030.00316.62
7.4.270.0030.00316.64
7.4.260.0050.00013.29
7.4.250.0040.00416.57
7.4.240.0070.00016.46
7.4.230.0070.00016.35
7.4.220.0060.01216.60
7.4.210.0100.00716.67
7.4.200.0070.00016.66
7.4.190.0030.00316.54
7.4.160.0070.01016.39
7.4.150.0070.01117.40
7.4.140.0120.00517.86
7.4.130.0080.01016.53
7.4.120.0120.00616.57
7.4.110.0090.00916.66
7.4.100.0110.00716.71
7.4.90.0030.01516.42
7.4.80.0120.00719.37
7.4.70.0070.01016.54
7.4.60.0100.00716.53
7.4.50.0080.00016.14
7.4.40.0130.00322.52
7.4.30.0030.01416.63
7.4.00.0060.01315.06
7.3.330.0000.00613.32
7.3.320.0030.00313.41
7.3.310.0030.00616.35
7.3.300.0000.00716.33
7.3.290.0090.00916.39
7.3.280.0070.01116.44
7.3.270.0030.01717.40
7.3.260.0110.00718.24
7.3.250.0070.01016.49
7.3.240.0100.00716.66
7.3.230.0140.00516.45
7.3.210.0100.00716.59
7.3.200.0080.00819.39
7.3.190.0000.01516.50
7.3.180.0150.00916.65
7.3.170.0030.01316.56
7.3.160.0110.00516.64
7.3.120.0070.00915.02
7.3.110.0080.00715.21
7.3.100.0050.01315.13
7.3.90.0050.00915.07
7.3.80.0050.01214.94
7.3.70.0060.00615.10
7.3.60.0050.00915.11
7.3.50.0020.01015.10
7.3.40.0030.00615.05
7.3.30.0100.00615.08
7.3.20.0070.00616.68
7.3.10.0050.00816.75
7.3.00.0080.00816.71
7.2.330.0080.00816.80
7.2.320.0070.01416.79
7.2.310.0130.00416.63
7.2.300.0100.01316.74
7.2.290.0000.01716.54
7.2.250.0120.00515.29
7.2.240.0070.01015.05
7.2.230.0030.01415.24
7.2.220.0060.00815.25
7.2.210.0090.00815.14
7.2.200.0050.00815.20
7.2.190.0050.01015.13
7.2.180.0040.00915.17
7.2.170.0050.00615.27
7.2.00.0040.00719.36
7.1.330.0020.01315.82
7.1.320.0030.00715.76
7.1.310.0090.00715.66
7.1.300.0060.00915.79
7.1.290.0030.00815.80
7.1.280.0050.00915.79
7.1.270.0050.01015.58
7.1.260.0080.00615.82
7.1.200.0120.00315.93
7.1.100.0000.00817.82
7.1.70.0070.00017.09
7.1.60.0060.00919.40
7.1.50.0000.01116.69
7.1.00.0000.06022.45
7.0.200.0030.00916.80
7.0.140.0000.07321.99
7.0.70.0030.07021.82
7.0.60.0000.06721.64
7.0.50.0070.07722.03
7.0.40.0070.07020.12
7.0.30.0070.05720.04
7.0.20.0000.08020.08
7.0.10.0030.09020.04
7.0.00.0070.08020.02
5.6.280.0000.07721.14
5.6.220.0030.07020.59
5.6.210.0100.05020.57
5.6.200.0070.06721.06
5.6.190.0070.05321.05
5.6.180.0070.08021.05
5.6.170.0130.08021.07
5.6.160.0130.07020.95
5.6.150.0100.07721.10
5.6.140.0030.06720.95
5.6.130.0070.07721.02
5.6.120.0070.07321.11
5.6.110.0030.07021.11
5.6.100.0030.08321.11
5.6.90.0000.05321.07
5.6.80.0030.07720.51
5.6.70.0030.08020.41
5.6.60.0100.07320.43
5.6.50.0100.07720.35
5.6.40.0030.04020.43
5.6.30.0100.07020.55
5.6.20.0030.05320.40
5.6.10.0030.08320.40
5.6.00.0030.08020.44
5.5.360.0070.05720.40
5.5.350.0070.05020.45
5.5.340.0100.07320.80
5.5.330.0100.06020.94
5.5.320.0030.05020.65
5.5.310.0000.09020.81
5.5.300.0000.09020.77
5.5.290.0100.04720.85
5.5.280.0030.08020.84
5.5.270.0030.09020.93
5.5.260.0100.07720.61
5.5.250.0100.05320.72
5.5.240.0100.07320.12
5.5.230.0070.07320.26
5.5.220.0070.07020.27
5.5.210.0030.06020.30
5.5.200.0030.06020.18
5.5.190.0070.06020.26
5.5.180.0070.04719.97
5.5.160.0000.05720.30
5.5.150.0000.04320.23
5.5.140.0130.04020.25
5.5.130.0030.08020.19
5.5.120.0030.08020.10
5.5.110.0070.04320.13
5.5.100.0030.05020.14
5.5.90.0070.03720.07
5.5.80.0070.08020.18
5.5.70.0000.08720.11
5.5.60.0100.05019.96
5.5.50.0070.05719.95
5.5.40.0030.05020.07
5.5.30.0070.05020.07
5.5.20.0030.04720.13
5.5.10.0070.04720.04
5.5.00.0000.06720.13
5.4.450.0100.07719.38
5.4.440.0030.08719.52
5.4.430.0030.07719.55
5.4.420.0000.08019.55
5.4.410.0000.05719.07
5.4.400.0000.04319.10
5.4.390.0030.07318.85
5.4.380.0030.05019.03
5.4.370.0070.07019.04
5.4.360.0130.07019.13
5.4.350.0000.04018.85
5.4.340.0070.03719.12
5.4.320.0070.08019.12
5.4.310.0030.07318.87
5.4.300.0100.06719.09
5.4.290.0030.05019.11
5.4.280.0030.07319.12
5.4.270.0100.07019.09
5.4.260.0000.04019.05
5.4.250.0000.04019.07
5.4.240.0070.07018.84
5.4.230.0100.06319.02
5.4.220.0130.07019.16
5.4.210.0000.05319.02
5.4.200.0000.06019.20
5.4.190.0070.07319.14
5.4.180.0000.07019.05
5.4.170.0070.06319.11
5.4.160.0000.08019.02
5.4.150.0070.08019.20
5.4.140.0030.07316.43
5.4.130.0070.05016.44
5.4.120.0070.06716.32
5.4.110.0030.05716.51
5.4.100.0000.07316.39
5.4.90.0030.07316.33
5.4.80.0000.05316.37
5.4.70.0100.06316.47
5.4.60.0070.06316.32
5.4.50.0070.05716.36
5.4.40.0130.06016.51
5.4.30.0000.07716.53
5.4.20.0070.06716.39
5.4.10.0030.07716.42
5.4.00.0070.07315.84
5.3.290.0070.07014.81
5.3.280.0070.07314.54
5.3.270.0000.07714.77
5.3.260.0000.06714.59
5.3.250.0000.08014.72
5.3.240.0100.06014.72
5.3.230.0030.04714.63
5.3.220.0100.07014.54
5.3.210.0000.06014.66
5.3.200.0070.07714.61
5.3.190.0000.06014.70
5.3.180.0030.07314.61
5.3.170.0000.08014.53
5.3.160.0070.07714.60
5.3.150.0030.07014.52
5.3.140.0000.07714.62
5.3.130.0000.08014.52
5.3.120.0000.05014.68
5.3.110.0000.08014.56
5.3.100.0070.06714.02
5.3.90.0000.07714.16
5.3.80.0070.05714.10
5.3.70.0030.07714.10
5.3.60.0170.06014.14
5.3.50.0000.08014.02
5.3.40.0030.07714.03
5.3.30.0030.07313.94
5.3.20.0030.07313.85
5.3.10.0100.05313.68
5.3.00.0030.07013.58
5.2.170.0100.06012.52
5.2.160.0000.06312.52
5.2.150.0070.06012.52
5.2.140.0070.06312.52
5.2.130.0030.04712.52
5.2.120.0000.04012.52
5.2.110.0070.05712.52
5.2.100.0000.07012.52
5.2.90.0030.05312.52
5.2.80.0070.06312.52
5.2.70.0070.05712.52
5.2.60.0070.06012.52
5.2.50.0030.05312.52
5.2.40.0130.05012.52
5.2.30.0030.04012.52
5.2.20.0000.05312.52
5.2.10.0030.04012.52
5.2.00.0000.06012.52
5.1.60.0030.05012.52
5.1.50.0100.03012.52
5.1.40.0030.05012.52
5.1.30.0070.05712.52
5.1.20.0030.04012.52
5.1.10.0070.05312.52
5.1.00.0030.05312.52
5.0.50.0030.04712.52
5.0.40.0000.04712.52
5.0.30.0000.06712.52
5.0.20.0030.04012.52
5.0.10.0070.04312.52
5.0.00.0000.06712.52
4.4.90.0030.03312.52
4.4.80.0000.03712.52
4.4.70.0030.03312.52
4.4.60.0000.03312.52
4.4.50.0070.02312.52
4.4.40.0100.04312.52
4.4.30.0000.03012.52
4.4.20.0030.03712.52
4.4.10.0000.02712.52
4.4.00.0030.04012.52
4.3.110.0000.03312.52
4.3.100.0000.03712.52
4.3.90.0070.02712.52
4.3.80.0000.05312.52
4.3.70.0000.03712.52
4.3.60.0000.03712.52
4.3.50.0000.03712.52
4.3.40.0000.05712.52
4.3.30.0030.03312.52
4.3.20.0000.02312.52
4.3.10.0030.03312.52
4.3.00.0000.03712.52

preferences:
47.08 ms | 401 KiB | 5 Q