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 . ') ' . PHP_EOL; $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.60.0120.00616.88
8.3.50.0060.01222.05
8.3.40.0090.00618.79
8.3.30.0000.01419.05
8.3.20.0090.00620.07
8.3.10.0080.00023.66
8.3.00.0040.00420.84
8.2.180.0130.00716.88
8.2.170.0120.00922.96
8.2.160.0070.00720.31
8.2.150.0070.00024.18
8.2.140.0000.00924.66
8.2.130.0070.00726.16
8.2.120.0060.00319.36
8.2.110.0100.00020.28
8.2.100.0080.00417.84
8.2.90.0050.00319.18
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0030.00617.93
8.2.50.0000.00918.07
8.2.40.0040.00420.03
8.2.30.0070.00018.27
8.2.20.0050.00317.88
8.2.10.0000.00818.16
8.2.00.0030.00617.91
8.1.280.0100.00325.92
8.1.270.0040.00423.96
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00422.14
8.1.230.0050.00520.35
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0090.00017.35
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0080.00018.37
8.1.160.0020.00522.09
8.1.150.0000.00718.67
8.1.140.0040.00417.49
8.1.130.0080.00019.55
8.1.120.0040.00417.57
8.1.110.0050.00317.52
8.1.100.0080.00017.42
8.1.90.0040.00417.46
8.1.80.0040.00417.51
8.1.70.0000.00717.46
8.1.60.0000.00817.50
8.1.50.0030.00517.57
8.1.40.0000.00917.50
8.1.30.0050.00317.69
8.1.20.0000.00817.73
8.1.10.0000.00817.63
8.1.00.0000.00817.57
8.0.300.0060.00318.77
8.0.290.0040.00416.75
8.0.280.0000.00718.35
8.0.270.0030.00317.21
8.0.260.0030.00317.21
8.0.250.0060.00017.00
8.0.240.0030.00317.03
8.0.230.0000.00816.94
8.0.220.0030.00317.02
8.0.210.0000.00717.00
8.0.200.0030.00517.01
8.0.190.0070.00017.04
8.0.180.0000.00816.95
8.0.170.0000.00817.04
8.0.160.0000.00816.83
8.0.150.0000.00716.99
8.0.140.0040.00416.85
8.0.130.0060.00013.38
8.0.120.0080.00016.96
8.0.110.0080.00017.02
8.0.100.0000.00716.88
8.0.90.0040.00416.94
8.0.80.0090.00617.05
8.0.70.0000.00716.89
8.0.60.0080.00016.96
8.0.50.0000.00716.86
8.0.30.0090.01017.26
8.0.20.0070.01217.40
8.0.10.0040.00416.99
8.0.00.0030.01516.72
7.4.330.0000.00615.02
7.4.320.0000.00616.52
7.4.300.0060.00016.55
7.4.290.0070.00016.45
7.4.280.0040.00416.64
7.4.270.0000.00716.55
7.4.260.0000.00716.66
7.4.250.0040.00416.51
7.4.240.0020.00516.46
7.4.230.0000.00716.61
7.4.220.0100.01016.74
7.4.210.0040.01116.56
7.4.200.0030.00516.72
7.4.160.0040.01216.41
7.4.150.0100.00717.40
7.4.140.0060.01417.86
7.4.130.0060.01016.52
7.4.120.0050.01316.64
7.4.110.0120.00616.52
7.4.100.0030.01316.52
7.4.90.0090.00916.59
7.4.80.0130.00919.39
7.4.70.0170.00016.65
7.4.60.0100.00716.70
7.4.50.0040.00016.68
7.4.40.0110.00516.66
7.4.30.0060.01016.77
7.4.10.0120.00616.40
7.4.00.0080.00715.78
7.3.330.0000.00713.23
7.3.320.0030.00513.34
7.3.310.0070.00016.32
7.3.300.0000.00716.32
7.3.290.0070.00716.41
7.3.280.0070.01316.50
7.3.270.0080.01617.40
7.3.260.0130.00716.46
7.3.250.0120.00716.50
7.3.240.0090.01716.64
7.3.230.0160.00316.67
7.3.210.0140.00316.57
7.3.200.0080.00819.39
7.3.190.0130.00916.54
7.3.180.0100.00716.69
7.3.170.0140.00716.49
7.3.160.0120.00416.52
7.3.130.0000.01716.38
7.3.120.0040.00915.69
7.3.110.0030.01416.45
7.3.100.0040.01116.64
7.3.90.0100.00316.22
7.3.80.0100.00316.36
7.3.70.0070.00316.34
7.3.60.0100.00716.45
7.3.50.0070.01016.27
7.3.40.0000.00816.29
7.3.30.0120.00016.38
7.3.20.0030.01218.27
7.3.10.0070.00617.33
7.3.00.0090.00817.04
7.2.330.0090.00916.60
7.2.320.0040.01416.77
7.2.310.0080.00816.75
7.2.300.0030.01616.60
7.2.290.0120.00616.74
7.2.260.0130.00616.50
7.2.250.0130.00616.76
7.2.240.0040.01116.51
7.2.230.0000.01816.51
7.2.220.0000.01116.49
7.2.210.0040.00716.47
7.2.200.0060.00816.54
7.2.190.0070.00316.48
7.2.180.0000.01116.56
7.2.170.0040.01116.57
7.2.160.0060.00316.48
7.2.150.0060.01218.56
7.2.140.0090.00618.52
7.2.130.0090.00617.52
7.2.120.0130.00517.48
7.2.110.0060.00817.29
7.2.100.0050.00917.30
7.2.90.0080.00817.06
7.2.80.0060.00717.23
7.2.70.0050.00917.25
7.2.60.0080.00517.17
7.2.50.0050.00717.47
7.2.40.0110.00617.51
7.2.30.0090.00517.13
7.2.20.0090.00617.16
7.2.10.0130.00417.47
7.2.00.0050.00917.82
7.1.330.0040.01117.32
7.1.320.0060.00317.43
7.1.310.0090.00317.38
7.1.300.0000.00917.27
7.1.290.0040.00817.52
7.1.280.0040.00917.42
7.1.270.0070.01117.40
7.1.260.0050.00517.38
7.1.250.0090.00616.45
7.1.240.0030.00717.32
7.1.230.0060.00516.62
7.1.220.0050.00916.53
7.1.210.0080.00716.43
7.1.200.0070.00916.34
7.1.190.0050.00916.53
7.1.180.0100.00416.59
7.1.170.0070.00516.36
7.1.160.0050.01116.63
7.1.150.0050.00816.40
7.1.140.0050.00716.66
7.1.130.0100.00316.67
7.1.120.0100.00516.59
7.1.110.0050.00816.51
7.1.100.0040.00817.18
7.1.90.0060.00616.46
7.1.80.0070.01016.39
7.1.70.0010.01216.72
7.1.60.0070.00816.77
7.1.50.0060.00716.70
7.1.40.0040.01116.55
7.1.30.0060.01216.67
7.1.20.0080.01216.65
7.1.10.0040.00916.53
7.1.00.0040.03818.51
7.0.330.0040.01117.05
7.0.320.0030.00716.91
7.0.310.0120.00216.17
7.0.300.0060.00616.17
7.0.290.0080.01016.38
7.0.280.0120.00416.14
7.0.270.0060.00416.22
7.0.260.0100.00416.24
7.0.250.0110.00616.27
7.0.240.0060.00716.21
7.0.230.0060.01016.02
7.0.220.0070.00316.13
7.0.210.0100.00716.09
7.0.200.0060.00816.39
7.0.190.0060.00816.23
7.0.180.0060.00516.26
7.0.170.0030.01116.36
7.0.160.0110.00516.21
7.0.150.0130.00516.07
7.0.140.0080.02618.18
7.0.130.0090.00516.15
7.0.120.0110.00616.18
7.0.110.0070.00915.97
7.0.100.0060.01116.16
7.0.90.0050.00815.96
7.0.80.0080.02917.50
7.0.70.0100.01817.40
7.0.60.0100.03317.39
7.0.50.0210.03617.53
7.0.40.0070.03316.19
7.0.30.0140.03016.10
7.0.20.0130.02516.22
7.0.10.0080.02516.18
7.0.00.0100.03416.26
5.6.400.0030.01416.02
5.6.390.0030.01015.91
5.6.380.0050.00815.10
5.6.370.0030.01115.34
5.6.360.0050.00715.36
5.6.350.0080.00515.19
5.6.340.0070.00615.14
5.6.330.0120.00315.13
5.6.320.0070.00715.20
5.6.310.0030.01115.14
5.6.300.0090.00515.08
5.6.290.0060.00715.11
5.6.280.0100.02617.04
5.6.270.0070.00614.81
5.6.260.0050.01215.07
5.6.250.0110.00515.06
5.6.240.0070.00715.06
5.6.230.0090.01916.93
5.6.220.0120.03016.97
5.6.210.0070.03017.11
5.6.200.0110.02917.09
5.6.190.0080.02717.18
5.6.180.0080.03417.18
5.6.170.0100.03117.13
5.6.160.0090.02317.07
5.6.150.0090.03617.13
5.6.140.0090.02317.29
5.6.130.0070.02517.09
5.6.120.0120.03117.16
5.6.110.0110.03317.26
5.6.100.0140.03317.12
5.6.90.0150.02116.96
5.6.80.0060.03216.93
5.6.70.0090.03016.87
5.6.60.0090.03116.79
5.6.50.0120.02916.80
5.6.40.0080.03016.82
5.6.30.0090.03016.81
5.6.20.0080.02316.89
5.6.10.0040.02816.88
5.6.00.0110.01916.91
5.5.380.0100.00513.52
5.5.370.0060.01915.86
5.5.360.0070.02015.88
5.5.350.0080.01815.89
5.5.340.0120.01215.92
5.5.330.0080.02815.86
5.5.320.0060.02215.97
5.5.310.0060.02415.95
5.5.300.0070.02516.01
5.5.290.0080.03116.00
5.5.280.0060.03615.96
5.5.270.0080.03015.95
5.5.260.0060.03316.00
5.5.250.0130.02415.85
5.5.240.0060.03215.66
5.5.230.0030.03615.60
5.5.220.0100.02815.61
5.5.210.0080.02515.77
5.5.200.0040.02915.62
5.5.190.0080.02715.64
5.5.180.0080.02615.86
5.5.170.0030.01315.21
5.5.160.0060.01915.67
5.5.150.0100.01415.67
5.5.140.0050.01815.65
5.5.130.0050.03115.78
5.5.120.0060.02215.65
5.5.110.0070.02415.67
5.5.100.0040.02815.78
5.5.90.0060.02915.76
5.5.80.0070.03015.66
5.5.70.0090.02815.71
5.5.60.0090.01715.81
5.5.50.0060.02115.65
5.5.40.0060.02915.72
5.5.30.0040.02315.78
5.5.20.0050.02815.75
5.5.10.0060.03115.68
5.5.00.0070.02515.62
5.4.450.0070.02314.43
5.4.440.0060.03114.46
5.4.430.0040.02214.41
5.4.420.0070.02914.42
5.4.410.0070.01914.46
5.4.400.0060.02614.35
5.4.390.0070.03214.24
5.4.380.0080.02914.28
5.4.370.0070.01714.38
5.4.360.0060.02314.29
5.4.350.0080.02614.11
5.4.340.0040.01814.35
5.4.330.0020.00711.80
5.4.320.0050.02914.37
5.4.310.0040.01814.43
5.4.300.0070.02414.30
5.4.290.0010.02614.16
5.4.280.0050.02014.22
5.4.270.0110.02414.30
5.4.260.0100.02614.29
5.4.250.0050.03114.10
5.4.240.0050.03014.20
5.4.230.0060.02914.37
5.4.220.0040.02914.39
5.4.210.0090.02714.22
5.4.200.0060.01814.40
5.4.190.0060.02714.16
5.4.180.0030.03414.21
5.4.170.0070.02914.33
5.4.160.0080.02614.33
5.4.150.0050.02714.30
5.4.140.0060.02813.42
5.4.130.0040.03113.39
5.4.120.0040.02713.39
5.4.110.0040.02213.42
5.4.100.0040.03013.47
5.4.90.0040.02213.29
5.4.80.0060.02613.47
5.4.70.0020.01713.41
5.4.60.0090.02213.34
5.4.50.0070.01613.38
5.4.40.0040.02013.38
5.4.30.0010.02013.49
5.4.20.0030.02713.33
5.4.10.0050.01513.40
5.4.00.0060.01213.15
5.3.290.0060.01812.84
5.3.280.0050.02712.86
5.3.270.0050.02412.90
5.3.260.0060.02212.92
5.3.250.0030.02212.71
5.3.240.0070.02212.68
5.3.230.0040.03012.70
5.3.220.0080.02512.69
5.3.210.0050.02912.57
5.3.200.0050.02212.72
5.3.190.0010.02012.69
5.3.180.0060.01612.84
5.3.170.0060.01812.76
5.3.160.0070.02012.67
5.3.150.0070.01512.72
5.3.140.0040.01712.67
5.3.130.0040.03112.79
5.3.120.0010.02112.75
5.3.110.0030.02112.67
5.3.100.0020.01912.50
5.3.90.0030.02112.62
5.3.80.0060.02812.41
5.3.70.0040.03112.52
5.3.60.0070.02712.56
5.3.50.0060.03212.53
5.3.40.0060.03012.47
5.3.30.0050.02712.54
5.3.20.0050.02012.46
5.3.10.0070.02112.18
5.3.00.0070.02612.19
5.2.170.0050.02310.89
5.2.160.0070.03011.04
5.2.150.0080.02311.04
5.2.140.0080.02610.87
5.2.130.0050.03310.90
5.2.120.0070.02610.87
5.2.110.0060.03310.89
5.2.100.0080.02811.02
5.2.90.0030.03410.98
5.2.80.0020.03510.81
5.2.70.0030.03010.94
5.2.60.0100.02310.91
5.2.50.0030.03210.80
5.2.40.0080.03210.97
5.2.30.0060.03010.95
5.2.20.0030.03810.95
5.2.10.0030.02810.76
5.2.00.0020.02410.83
5.1.60.0030.03110.59
5.1.50.0050.02210.59
5.1.40.0030.03010.59
5.1.30.0060.02610.60
5.1.20.0030.03110.59
5.1.10.0040.01810.59
5.1.00.0050.02810.59
5.0.50.0050.02310.59
5.0.40.0030.02310.59
5.0.30.0040.02310.59
5.0.20.0040.02310.59
5.0.10.0080.01810.59
5.0.00.0020.01910.59
4.4.90.0010.01810.59
4.4.80.0020.01310.59
4.4.70.0030.01910.59
4.4.60.0030.01810.59
4.4.50.0050.01710.59
4.4.40.0020.02810.59
4.4.30.0020.02210.59
4.4.20.0020.01310.59
4.4.10.0020.02010.59
4.4.00.0020.03010.59
4.3.110.0030.01510.59
4.3.100.0020.01310.59
4.3.90.0020.01110.59
4.3.80.0030.02810.59
4.3.70.0020.01810.59
4.3.60.0020.01810.59
4.3.50.0050.01710.59
4.3.40.0060.02310.59
4.3.30.0070.01510.59
4.3.20.0010.01610.59
4.3.10.0030.01810.59
4.3.00.0020.01810.59

preferences:
49.99 ms | 401 KiB | 5 Q