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 $iterated . '(' . $object->val . ') - '; $storage->next(); if($iterated === 5) { // echo ' ' . $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.60.0070.00716.75
8.3.50.0130.00517.45
8.3.40.0040.01118.83
8.3.30.0090.00618.85
8.3.20.0000.00918.73
8.3.10.0040.00418.85
8.3.00.0060.00319.38
8.2.180.0120.00316.63
8.2.170.0080.00822.96
8.2.160.0090.00618.89
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0000.00720.90
8.2.110.0070.00320.81
8.2.100.0030.00917.91
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0030.00617.93
8.2.50.0030.00517.93
8.2.40.0030.00619.19
8.2.30.0070.00317.83
8.2.20.0050.00517.73
8.2.10.0040.00417.76
8.2.00.0080.00417.75
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0040.00421.42
8.1.230.0110.00017.70
8.1.220.0030.00517.79
8.1.210.0060.00318.77
8.1.200.0040.00417.48
8.1.190.0030.00617.25
8.1.180.0000.00818.10
8.1.170.0080.00017.62
8.1.160.0000.00719.04
8.1.150.0000.00718.54
8.1.140.0050.00217.46
8.1.130.0000.00717.35
8.1.120.0070.00017.40
8.1.110.0080.00017.53
8.1.100.0000.00717.40
8.1.90.0000.00817.52
8.1.80.0070.00017.50
8.1.70.0030.00317.47
8.1.60.0040.00417.50
8.1.50.0020.00517.58
8.1.40.0060.00317.50
8.1.30.0040.00417.51
8.1.20.0040.00417.66
8.1.10.0000.00817.58
8.1.00.0040.00417.56
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0030.00318.53
8.0.270.0000.00717.20
8.0.260.0060.00016.90
8.0.250.0040.00417.00
8.0.240.0040.00416.85
8.0.230.0040.00416.97
8.0.220.0040.00416.98
8.0.210.0040.00416.94
8.0.200.0000.00716.98
8.0.190.0040.00417.03
8.0.180.0090.00316.91
8.0.170.0060.00317.02
8.0.160.0050.00317.08
8.0.150.0000.00916.89
8.0.140.0050.00316.87
8.0.130.0030.00313.40
8.0.120.0000.00916.84
8.0.110.0000.00717.04
8.0.100.0050.00217.02
8.0.90.0030.00317.02
8.0.80.0040.01116.94
8.0.70.0040.00416.86
8.0.60.0090.00016.86
8.0.50.0030.00616.79
8.0.30.0040.01117.09
8.0.20.0120.01117.33
8.0.10.0070.00016.96
8.0.00.0120.01216.86
7.4.330.0000.00513.00
7.4.320.0030.00316.54
7.4.300.0000.00716.67
7.4.290.0070.00316.63
7.4.280.0080.00016.55
7.4.270.0000.00716.64
7.4.260.0030.00313.36
7.4.250.0040.00416.50
7.4.240.0000.00816.63
7.4.230.0030.00616.61
7.4.220.0060.01316.59
7.4.210.0080.00816.73
7.4.200.0030.00316.54
7.4.190.0080.00016.77
7.4.160.0060.00916.51
7.4.150.0070.01316.56
7.4.140.0110.00717.86
7.4.130.0100.01116.41
7.4.120.0070.01016.51
7.4.110.0110.00716.47
7.4.100.0060.01616.58
7.4.90.0030.01716.52
7.4.80.0030.01719.39
7.4.70.0000.01616.59
7.4.60.0080.00816.72
7.4.50.0000.00916.62
7.4.40.0100.00716.66
7.4.30.0130.00316.67
7.4.00.0090.00615.04
7.3.330.0000.00713.40
7.3.320.0000.00613.30
7.3.310.0030.00316.48
7.3.300.0000.00716.45
7.3.290.0070.00916.42
7.3.280.0060.00816.45
7.3.270.0070.01716.46
7.3.260.0150.00416.61
7.3.240.0130.01016.43
7.3.230.0040.01316.53
7.3.210.0080.00816.64
7.3.200.0100.01316.54
7.3.190.0180.00416.51
7.3.180.0140.00416.52
7.3.170.0130.00716.46
7.3.160.0150.00616.60
7.3.120.0100.00315.09
7.3.10.0170.00716.52
7.3.00.0110.00516.45
7.2.330.0080.01416.70
7.2.320.0130.00716.93
7.2.310.0090.00916.81
7.2.300.0100.01316.59
7.2.290.0000.01716.45
7.2.130.0100.00816.69
7.2.120.0090.00716.72
7.2.110.0140.00816.52
7.2.100.0140.00816.71
7.2.90.0120.00716.71
7.2.80.0120.00916.95
7.2.70.0110.01016.68
7.2.60.0170.00316.75
7.2.50.0140.01116.97
7.2.40.0050.01216.96
7.2.30.0090.01016.79
7.2.20.0110.00616.71
7.2.10.0110.00616.52
7.2.00.0090.00717.80
7.1.250.0090.00715.62
7.1.100.0210.00717.96
7.1.70.0040.00417.34
7.1.60.0120.01219.25
7.1.50.0040.01816.96
7.1.00.0070.05022.30
7.0.200.0050.00216.47
7.0.140.0000.07721.93
7.0.120.0030.07322.16
7.0.60.0030.06319.96
7.0.50.0130.07317.91
7.0.40.0070.07320.23
7.0.30.0030.08320.10
7.0.20.0300.06320.09
7.0.10.0030.04320.06
7.0.00.0030.04720.19
5.6.280.0100.06321.09
5.6.210.0100.04020.52
5.6.200.0030.09318.18
5.6.190.0000.05020.77
5.6.180.0200.08720.56
5.6.170.0130.05720.45
5.6.160.0030.05720.54
5.6.150.0070.08018.14
5.6.140.0070.04718.28
5.6.130.0100.08318.15
5.6.120.0000.09021.02
5.6.110.0030.04321.15
5.6.100.0030.07320.99
5.6.90.0100.08321.02
5.6.80.0070.05720.55
5.5.350.3900.03720.42
5.5.340.0030.05318.02
5.5.330.0100.06320.25
5.5.320.0430.04320.24
5.5.310.0330.05020.33
5.5.300.0030.08018.09
5.5.290.0000.08317.95
5.5.280.0070.04320.86
5.5.270.0000.04320.75
5.5.260.0100.07720.84
5.5.250.0070.07020.79
5.5.240.0370.07020.18
5.4.450.0300.07319.55
5.4.440.0370.05319.27
5.4.430.0200.05319.45
5.4.420.0270.06019.30
5.4.410.0330.04719.52
5.4.400.0130.05019.25
5.4.390.0400.03718.98
5.4.380.0270.05019.25
5.4.370.0230.04319.09
5.4.360.0270.07319.31
5.4.350.0370.04019.00
5.4.340.0230.04318.97
5.4.320.0200.05019.00
5.4.310.0170.04018.84
5.4.300.0230.06019.31
5.4.290.0300.06718.94
5.4.280.0300.03718.99
5.4.270.0230.04019.06
5.4.260.0300.07018.83
5.4.250.0300.07319.23
5.4.240.0170.05319.30
5.4.230.0330.06319.24
5.4.220.0300.04718.95
5.4.210.0200.04019.30
5.4.200.0300.07019.23
5.4.190.0370.05719.13
5.4.180.0300.04319.15
5.4.170.0200.05318.94
5.4.160.0270.07018.97
5.4.150.0370.06719.29
5.4.140.0330.04716.35
5.4.130.0300.05016.52
5.4.120.0170.04016.46
5.4.110.0270.05316.52
5.4.100.0230.04016.73
5.4.90.0270.03016.46
5.4.80.0300.04016.25
5.4.70.0300.06716.34
5.4.60.0370.05716.55
5.4.50.0230.05716.54
5.4.40.0270.06716.43
5.4.30.0300.06016.34
5.4.20.0170.04316.32
5.4.10.0400.05716.42
5.4.00.0270.04715.79
5.3.290.0270.04714.69
5.3.280.0300.07014.62
5.3.270.0330.06014.63
5.3.260.0230.04314.64
5.3.250.0200.03714.55
5.3.240.0230.03014.64
5.3.230.0230.03714.53
5.3.220.0330.06314.64
5.3.210.0230.04314.73
5.3.200.0230.07314.57
5.3.190.0300.04314.48
5.3.180.0270.06314.48
5.3.170.0230.04714.81
5.3.160.0230.05014.59
5.3.150.0200.04714.50
5.3.140.0400.06014.49
5.3.130.0230.05314.50
5.3.120.0370.06314.71
5.3.110.0300.07014.71
5.3.100.0200.04714.28
5.3.90.0230.04714.04
5.3.80.0170.04314.15
5.3.70.0230.04013.95
5.3.60.0230.07014.17
5.3.50.0300.04713.88
5.3.40.0370.06313.98
5.3.30.0270.06314.06
5.3.20.0330.03713.72
5.3.10.0300.03013.79
5.3.00.0270.04313.56
5.2.170.0270.05713.04
5.2.160.0200.05013.04
5.2.150.0300.03313.04
5.2.140.0230.04713.04
5.2.130.0170.05313.04
5.2.120.0200.05713.04
5.2.110.0270.03713.04
5.2.100.0230.05313.04
5.2.90.0230.04713.04
5.2.80.0330.05013.04
5.2.70.0270.03713.04
5.2.60.0270.05313.04
5.2.50.0200.03313.04
5.2.40.0130.03713.04
5.2.30.0170.03713.04
5.2.20.0170.05313.04
5.2.10.0170.03313.04
5.2.00.0170.05713.04
5.1.60.0170.02313.04
5.1.50.0100.02713.04
5.1.40.0170.02713.04
5.1.30.0230.04713.04
5.1.20.0270.03013.04
5.1.10.0170.05313.04
5.1.00.0170.03013.04
5.0.50.0030.03013.04
5.0.40.0100.03313.04
5.0.30.0100.06313.04
5.0.20.0130.04013.04
5.0.10.0070.04013.04
5.0.00.0130.03713.04
4.4.90.0070.01713.04
4.4.80.0100.03713.04
4.4.70.0070.02313.04
4.4.60.0130.01313.04
4.4.50.0030.01713.04
4.4.40.0070.05713.04
4.4.30.0070.02713.04
4.4.20.0070.02013.04
4.4.10.0070.03713.04
4.4.00.0100.03713.04
4.3.110.0070.02013.04
4.3.100.0070.03713.04
4.3.90.0100.02713.04
4.3.80.0070.03713.04
4.3.70.0030.02013.04
4.3.60.0070.01313.04
4.3.50.0070.01713.04
4.3.40.0070.03713.04
4.3.30.0070.03713.04
4.3.20.0100.03013.04
4.3.10.0070.03313.04
4.3.00.0030.03713.04

preferences:
40.25 ms | 400 KiB | 5 Q