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(rand(0,1) === 1) { // echo ' ' . $object->val . ' '; $storage->detach($object); continue; } // echo PHP_EOL; } if(count($storage) != $expected) { echo 'Error!' . 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)
7.3.10.0070.01016.43
7.3.00.0000.01316.73
7.2.130.0070.00716.98
7.2.120.0040.00816.99
7.2.110.0030.01017.03
7.2.100.0000.01016.72
7.2.90.0100.00316.79
7.2.80.0070.01117.11
7.2.70.0100.00716.76
7.2.60.0030.01017.18
7.2.50.0000.01316.93
7.2.40.0100.00717.09
7.2.30.0000.01217.10
7.2.20.0040.01216.86
7.2.10.0090.00617.05
7.2.00.0070.00717.00
7.1.250.0090.00315.80
7.1.70.0030.00317.32
7.1.60.0090.01319.33
7.1.50.0090.01216.75
7.1.00.0030.07722.57
7.0.200.0080.00316.68
7.0.140.0070.07022.18
7.0.60.0100.06320.12
7.0.50.0070.08317.98
7.0.40.0070.08020.21
7.0.30.0170.05320.07
7.0.20.0330.06320.08
7.0.10.0100.07020.30
7.0.00.0000.04720.09
5.6.280.0070.06720.84
5.6.210.0100.03320.47
5.6.200.0030.09018.29
5.6.190.0130.08020.61
5.6.180.0330.07020.64
5.6.170.0300.07720.50
5.6.160.0130.03320.50
5.6.150.0030.08718.21
5.6.140.0100.07018.23
5.6.130.0170.07318.21
5.6.120.0070.09020.94
5.6.110.0070.04721.06
5.6.100.0030.07721.02
5.6.90.0070.05021.10
5.6.80.0130.07720.46
5.6.70.4530.04320.45
5.5.350.0130.07720.46
5.5.340.0070.08317.95
5.5.330.0170.08020.35
5.5.320.0230.08020.27
5.5.310.0230.04320.26
5.5.300.0070.03717.96
5.5.290.0070.07718.05
5.5.280.0100.07320.89
5.5.270.0130.07020.91
5.5.260.0070.08020.86
5.5.250.0030.08320.71
5.5.240.0000.08020.21
5.4.450.0830.03719.17
5.4.440.0570.06719.53
5.4.430.0500.06319.24
5.4.420.0370.05019.41
5.4.410.0870.05019.45
5.4.400.0730.06018.89
5.4.390.0830.06718.91
5.4.380.0370.03718.54
5.4.370.0230.04718.83
5.4.360.0230.05718.52
5.4.350.0230.06018.71
5.4.340.0200.05318.84
5.4.320.0040.03912.52
5.4.310.0050.03812.52
5.4.300.0060.04412.52
5.4.290.0060.04212.51
5.4.280.0070.04012.42
5.4.270.0100.03212.41
5.4.260.0060.03712.41
5.4.250.0060.04212.41
5.4.240.0050.03712.41
5.4.230.0050.03912.41
5.4.220.0060.03912.41
5.4.210.0040.04112.41
5.4.200.0080.03812.41
5.4.190.0170.04212.39
5.4.180.0180.03912.40
5.4.170.0200.03812.41
5.4.160.0200.03812.39
5.4.150.0180.04012.39
5.4.140.0180.04012.08
5.4.130.0160.04912.07
5.4.120.0120.04512.02
5.4.110.0120.04412.02
5.4.100.0280.06012.02
5.4.90.0160.04212.02
5.4.80.0190.03812.02
5.4.70.0120.04412.02
5.4.60.0260.06012.01
5.4.50.0150.04112.02
5.4.40.0180.03712.00
5.4.30.0180.04012.00
5.4.20.0160.04112.00
5.4.10.0120.04512.00
5.4.00.0170.03911.50
5.3.290.0080.04012.80
5.3.280.0090.04812.71
5.3.270.0480.10812.72
5.3.260.0150.05012.72
5.3.250.0170.04512.72
5.3.240.0170.04512.72
5.3.230.0270.06812.71
5.3.220.0200.03912.68
5.3.210.0140.04512.68
5.3.200.0160.04312.68
5.3.190.0120.04812.68
5.3.180.0160.04312.67
5.3.170.0180.04112.67
5.3.160.0170.04312.67
5.3.150.0150.04412.67
5.3.140.0160.04312.66
5.3.130.0340.08612.66
5.3.120.0130.04712.66
5.3.110.0170.04212.65
5.3.100.0170.04212.14
5.3.90.0160.04112.14
5.3.80.0190.04012.11
5.3.70.0140.04512.11
5.3.60.0160.04312.10
5.3.50.0130.04612.05
5.3.40.0130.04612.05
5.3.30.0160.04112.02
5.3.20.0110.04911.79
5.3.10.0170.06811.75
5.3.00.0130.04311.73
5.2.170.0190.0299.25
5.2.160.0110.0369.25
5.2.150.0140.0339.25
5.2.140.0140.0349.25
5.2.130.0320.0749.21
5.2.120.0110.0379.20
5.2.110.0070.0419.21
5.2.100.0120.0359.21
5.2.90.0150.0319.21
5.2.80.0140.0339.20
5.2.70.0130.0359.20
5.2.60.0130.0339.16
5.2.50.0160.0319.12
5.2.40.0130.0359.10
5.2.30.0150.0349.07
5.2.20.0120.0349.07
5.2.10.0150.0428.97
5.2.00.0110.0338.82
5.1.60.0180.0258.11
5.1.50.0170.0288.11
5.1.40.0110.0308.09
5.1.30.0330.0708.44
5.1.20.0130.0328.46
5.1.10.0140.0288.18
5.1.00.0130.0288.18
5.0.50.0130.0216.66
5.0.40.0070.0276.52
5.0.30.0070.0416.34
5.0.20.0080.0246.30
5.0.10.0180.0436.28
5.0.00.0090.0356.27
4.4.90.0060.0194.78
4.4.80.0060.0194.76
4.4.70.0070.0184.75
4.4.60.0080.0174.76
4.4.50.0090.0154.77
4.4.40.0060.0294.71
4.4.30.0030.0244.76
4.4.20.0080.0184.85
4.4.10.0040.0224.85
4.4.00.0090.0274.76
4.3.110.0100.0154.67
4.3.100.0080.0164.66
4.3.90.0100.0154.64
4.3.80.0070.0294.59
4.3.70.0080.0164.63
4.3.60.0190.0694.63
4.3.50.0100.0154.63
4.3.40.0100.0244.54
4.3.30.0070.0173.29
4.3.20.0060.0183.29
4.3.10.0050.0183.25
4.3.00.0130.01315.59

preferences:
36.68 ms | 401 KiB | 5 Q