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(); $iterated = 0; $expected = count($storage); while ($storage->valid()) { $iterated++; $object = $storage->current(); echo 'Iteration #' .$iterated . ' with object A(' . $object->val . ')'; $storage->next(); if($iterated === 2) { echo ' - deleted Object A(' . $object->val . ') '; $storage->detach($object); continue; } echo PHP_EOL; } if(count($storage) != $expected) { 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.40.0120.00318.70
8.3.30.0030.01419.12
8.3.20.0040.00420.32
8.3.10.0080.00023.53
8.3.00.0040.00422.40
8.2.170.0100.00622.96
8.2.160.0070.00721.95
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0160.00317.63
8.2.110.0130.00922.34
8.2.100.0060.00617.84
8.2.90.0050.00319.21
8.2.80.0030.00618.00
8.2.70.0040.00417.50
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0000.00818.09
8.2.30.0000.00718.10
8.2.20.0070.00017.63
8.2.10.0040.00417.91
8.2.00.0000.00717.83
8.1.270.0050.00322.03
8.1.260.0000.00726.35
8.1.250.0120.00428.09
8.1.240.0100.01023.83
8.1.230.0040.00719.10
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0000.01217.52
8.1.180.0000.00818.10
8.1.170.0030.00518.62
8.1.160.0000.00821.99
8.1.150.0000.00818.63
8.1.140.0050.00517.38
8.1.130.0030.00317.98
8.1.120.0040.00617.47
8.1.110.0030.00417.46
8.1.100.0000.00717.52
8.1.90.0000.00717.39
8.1.80.0040.00417.54
8.1.70.0030.00317.40
8.1.60.0060.00617.63
8.1.50.0020.00517.45
8.1.40.0060.00317.55
8.1.30.0040.00417.68
8.1.20.0050.00317.62
8.1.10.0040.00417.54
8.1.00.0000.00817.43
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0070.00018.47
8.0.270.0030.00517.39
8.0.260.0060.00017.00
8.0.250.0030.00317.11
8.0.240.0060.00317.07
8.0.230.0050.00317.06
8.0.220.0000.00716.85
8.0.210.0030.00316.97
8.0.200.0030.00316.94
8.0.190.0000.00817.02
8.0.180.0040.00416.94
8.0.170.0060.00316.98
8.0.160.0090.00017.11
8.0.150.0040.00416.85
8.0.140.0060.00317.04
8.0.130.0000.00513.38
8.0.120.0000.00816.89
8.0.110.0070.00016.90
8.0.100.0050.00316.88
8.0.90.0040.00417.05
8.0.80.0040.01216.99
8.0.70.0040.00416.82
8.0.60.0040.00416.86
8.0.50.0070.00016.99
8.0.30.0090.01117.20
8.0.20.0110.00917.40
8.0.10.0050.00216.98
8.0.00.0130.00516.75
7.4.330.0000.00515.10
7.4.320.0000.00616.53
7.4.300.0060.00016.61
7.4.290.0030.00316.40
7.4.280.0070.00016.45
7.4.270.0070.00016.43
7.4.260.0040.00216.58
7.4.250.0070.00016.61
7.4.240.0020.00516.64
7.4.230.0030.00316.72
7.4.220.0120.01016.57
7.4.210.0090.00916.66
7.4.200.0000.00716.45
7.4.190.0030.00316.52
7.4.160.0090.00616.53
7.4.150.0110.01117.40
7.4.140.0130.00817.86
7.4.130.0140.00816.52
7.4.120.0140.00516.67
7.4.110.0070.01016.84
7.4.100.0060.01116.56
7.4.90.0090.01216.44
7.4.80.0090.00916.71
7.4.70.0030.01516.62
7.4.60.0060.01516.55
7.4.50.0000.00916.57
7.4.40.0040.01122.77
7.4.30.0060.01016.39
7.4.00.0060.01014.95
7.3.330.0060.00013.48
7.3.320.0020.00213.32
7.3.310.0000.00716.35
7.3.300.0060.00016.33
7.3.290.0030.01016.51
7.3.280.0100.01016.46
7.3.270.0000.01717.40
7.3.260.0100.00716.48
7.3.250.0070.01316.70
7.3.240.0100.00716.59
7.3.230.0040.01216.52
7.3.210.0070.01016.68
7.3.200.0190.00319.39
7.3.190.0120.00916.48
7.3.180.0050.01116.43
7.3.170.0030.01316.48
7.3.160.0110.00616.42
7.3.120.0120.00315.05
7.3.10.0050.01016.61
7.3.00.0120.00316.72
7.2.330.0110.00516.84
7.2.320.0090.00916.63
7.2.310.0130.00516.75
7.2.300.0030.02016.91
7.2.290.0120.00616.77
7.2.130.0070.00516.82
7.2.120.0080.00516.68
7.2.110.0050.01016.88
7.2.100.0050.01216.69
7.2.90.0070.01216.99
7.2.80.0060.00816.85
7.2.70.0090.00516.67
7.2.60.0050.01116.85
7.2.50.0080.00916.60
7.2.40.0080.00816.57
7.2.30.0100.00816.58
7.2.20.0080.01116.70
7.2.10.0070.00816.75
7.2.00.0040.01116.95
7.1.250.0030.00815.61
7.1.240.0030.00915.79
7.1.230.0040.00415.77
7.1.220.0000.01415.88
7.1.210.0080.00515.95
7.1.200.0050.00815.79
7.1.190.0110.00415.60
7.1.180.0050.00515.81
7.1.170.0080.01215.57
7.1.160.0090.00915.92
7.1.150.0040.00415.63
7.1.140.0100.00315.49
7.1.130.0090.00315.88
7.1.120.0040.00415.81
7.1.110.0030.01315.95
7.1.100.0070.00817.06
7.1.90.0070.00715.57
7.1.80.0040.00815.39
7.1.70.0080.00516.53
7.1.60.0110.00717.46
7.1.50.0090.00916.28
7.1.40.0030.00615.73
7.1.30.0040.00815.76
7.1.20.0060.00615.72
7.1.10.0080.00815.59
7.1.00.0030.04519.16
7.0.330.0030.00615.33
7.0.320.0090.00615.46
7.0.310.0050.00815.36
7.0.300.0000.01015.12
7.0.290.0060.00915.18
7.0.280.0060.01215.34
7.0.270.0090.00615.59
7.0.260.0030.01015.47
7.0.250.0000.01615.23
7.0.240.0070.00715.44
7.0.230.0080.00315.45
7.0.220.0100.01015.11
7.0.210.0060.00615.02
7.0.200.0030.00816.21
7.0.190.0030.00715.41
7.0.180.0100.00715.13
7.0.170.0000.01215.32
7.0.160.0110.00715.45
7.0.150.0090.00615.41
7.0.140.0000.04118.58
7.0.130.0150.00815.51
7.0.120.0230.00315.45
7.0.110.0240.00915.23
7.0.100.0150.02917.76
7.0.90.0220.04717.51
7.0.80.0050.04917.57
7.0.70.0100.03817.67
7.0.60.0070.04217.66
7.0.50.0070.02517.97
7.0.40.0030.04916.71
7.0.30.0050.04116.68
7.0.20.0090.02716.68
7.0.10.0080.02316.77
7.0.00.0090.04416.62
5.6.380.0030.00914.05
5.6.370.0070.00413.88
5.6.360.0090.00314.34
5.6.350.0070.01114.04
5.6.340.0070.00714.19
5.6.330.0030.01014.00
5.6.320.0030.00914.63
5.6.310.0030.00714.46
5.6.300.0070.00714.37
5.6.290.0070.01114.63
5.6.280.0050.04017.88
5.6.270.0070.01014.21
5.6.260.0040.01114.46
5.6.250.0100.04217.64
5.6.240.0080.03717.45
5.6.230.0020.03517.58
5.6.220.0050.04517.42
5.6.210.0080.04317.50
5.6.200.0080.03617.83
5.6.190.0070.02217.80
5.6.180.0080.03617.71
5.6.170.0080.02317.69
5.6.160.0050.02417.59
5.6.150.0080.02617.69
5.6.140.0000.03017.52
5.6.130.0070.04817.72
5.6.120.0080.04717.89
5.6.110.0080.03817.76
5.6.100.0100.04017.67
5.6.90.0130.04317.64
5.6.80.0070.02717.43
5.6.70.0080.04117.46
5.6.60.0020.04417.24
5.6.50.0120.03817.43
5.6.40.0080.02317.48
5.6.30.0050.04717.34
5.6.20.0050.02617.44
5.6.10.0060.03817.23
5.6.00.0130.03817.23
5.5.380.0050.04215.95
5.5.370.0070.03515.88
5.5.360.0080.04015.88
5.5.350.0070.02515.82
5.5.340.0050.03516.16
5.5.330.0030.04316.05
5.5.320.0020.03016.10
5.5.310.0080.03816.13
5.5.300.0060.03416.02
5.5.290.0000.03815.90
5.5.280.0070.03716.13
5.5.270.0000.03515.96
5.5.260.0080.03515.88
5.5.250.0110.03815.98
5.5.240.0070.04115.67
5.5.230.0100.04215.75
5.5.220.0060.02715.61
5.5.210.0130.03715.70
5.5.200.0060.02015.47
5.5.190.0130.01815.50
5.5.180.0070.03315.66
5.5.170.0000.01311.24
5.5.160.0080.03815.44
5.5.150.0030.04415.66
5.5.140.0060.04315.63
5.5.130.0120.03815.84
5.5.120.0100.02315.65
5.5.110.0060.02315.62
5.5.100.0030.02415.55
5.5.90.0120.03415.62
5.5.80.0050.04215.66
5.5.70.0100.03515.66
5.5.60.0070.03015.71
5.5.50.0130.03915.62
5.5.40.0080.03715.67
5.5.30.0100.03515.67
5.5.20.0030.02815.53
5.5.10.0170.04115.54
5.5.00.0090.02515.65
5.4.450.0100.04015.41
5.4.440.0080.02615.41
5.4.430.0070.03815.38
5.4.420.0060.03815.38
5.4.410.0110.02715.06
5.4.400.0050.04214.95
5.4.390.0110.04015.04
5.4.380.0090.03015.15
5.4.370.0080.02214.83
5.4.360.0090.04315.21
5.4.350.0070.04015.14
5.4.340.0130.03214.82
5.4.330.0030.01210.99
5.4.320.0050.04015.29
5.4.310.0080.02014.90
5.4.300.0060.03415.10
5.4.290.0070.04214.98
5.4.280.0150.03714.92
5.4.270.0120.03915.12
5.4.260.0140.03914.81
5.4.250.0050.02714.88
5.4.240.0110.04315.02
5.4.230.0080.03115.00
5.4.220.0100.02714.98
5.4.210.0120.03615.03
5.4.200.0070.02814.77
5.4.190.0120.04015.09
5.4.180.0060.03015.21
5.4.170.0110.02314.96
5.4.160.0130.01814.83
5.4.150.0120.04014.82
5.4.140.0140.03213.64
5.4.130.0060.02913.66
5.4.120.0120.03313.79
5.4.110.0080.03813.78
5.4.100.0150.02313.41
5.4.90.0100.01813.69
5.4.80.0120.02513.67
5.4.70.0030.04213.58
5.4.60.0020.04413.68
5.4.50.0120.03613.62
5.4.40.0050.03513.68
5.4.30.0090.04013.46
5.4.20.0090.02213.63
5.4.10.0090.04013.79
5.4.00.0090.03613.41
5.3.290.0100.02112.76
5.3.280.0040.04612.63
5.3.270.0070.03712.49
5.3.260.0060.02512.66
5.3.250.0070.02712.61
5.3.240.0070.03312.63
5.3.230.0050.02712.67
5.3.220.0110.04512.40
5.3.210.0070.03512.44
5.3.200.0050.02712.54
5.3.190.0090.02612.64
5.3.180.0100.02512.63
5.3.170.0100.03212.59
5.3.160.0120.03212.52
5.3.150.0070.02312.64
5.3.140.0040.03312.59
5.3.130.0130.02812.57
5.3.120.0180.02212.57
5.3.110.0100.02312.57
5.3.100.0110.03812.22
5.3.90.0050.02712.36
5.3.80.0020.04512.32
5.3.70.0090.03712.15
5.3.60.0080.03712.33
5.3.50.0120.03012.23
5.3.40.0070.03712.27
5.3.30.0070.02212.36
5.3.20.0070.02212.20
5.3.10.0020.04111.89
5.3.00.0080.03711.98
5.2.170.0070.02310.40
5.2.160.0040.02810.35
5.2.150.0040.03510.33
5.2.140.0050.03110.31
5.2.130.0060.03010.28
5.2.120.0060.02010.27
5.2.110.0030.03310.20
5.2.100.0080.03310.34
5.2.90.0070.02110.17
5.2.80.0060.02110.09
5.2.70.0100.03110.33
5.2.60.0080.03310.24
5.2.50.0100.01310.32
5.2.40.0030.03610.12
5.2.30.0090.01810.16
5.2.20.0090.01610.12
5.2.10.0110.0299.91
5.2.00.0070.0179.87
5.1.60.0130.0279.36
5.1.50.0170.0209.21
5.1.40.0120.0159.39
5.1.30.0100.0159.54
5.1.20.0060.0159.42
5.1.10.0100.0309.42
5.1.00.0020.0319.31
5.0.50.0050.0138.55
5.0.40.0060.0278.55
5.0.30.0040.0228.55
5.0.20.0070.0228.55
5.0.10.0080.0108.55
5.0.00.0030.0208.55
4.4.90.0040.0208.55
4.4.80.0030.0178.55
4.4.70.0030.0168.55
4.4.60.0020.0228.55
4.4.50.0110.0198.55
4.4.40.0100.0088.55
4.4.30.0030.0128.55
4.4.20.0070.0138.55
4.4.10.0050.0188.55
4.4.00.0050.0288.55
4.3.110.0080.0178.55
4.3.100.0070.0148.55
4.3.90.0050.0168.55
4.3.80.0030.0268.55
4.3.70.0000.0218.55
4.3.60.0020.0138.55
4.3.50.0050.0088.55
4.3.40.0030.0228.55
4.3.30.0020.0198.55
4.3.20.0050.0158.55
4.3.10.0040.0198.55
4.3.00.0020.0158.55

preferences:
39.75 ms | 400 KiB | 5 Q