3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $strings = array('SS2014','SU2014','FW2014','SS2013','FW2013','NW2012'); $cleanUpResult = array(); $counter = 0; $previousYear = ''; $currentIndex = 10; foreach($strings as $row){ if($counter == 0){ $previousYear = substr($row, -4); } var_dump($previousYear); if($previousYear !== substr($row, -4)){ $currentIndex += 10; } var_dump($previousYear); if($counter > 0){ $previousYear = substr($row, -4); } var_dump(substr($row, 0, 2)); var_dump(substr($row, -4)); switch(substr($row, 0, 2)){ case 'SS': $cleanUpResult[$currentIndex + 1] = $row; break; case 'SU': $cleanUpResult[$currentIndex + 2] = $row; break; case 'FW': $cleanUpResult[$currentIndex + 3] = $row; break; case 'WI': $cleanUpResult[$currentIndex + 4] = $row; break; case 'XM': $cleanUpResult[$currentIndex + 5] = $row; break; case 'CO': $cleanUpResult[$currentIndex + 6] = $row; break; case 'NW': $cleanUpResult[$currentIndex + 7] = $row; break; } $cleanUpResult[] = $row; $counter++; } var_dump($cleanUpResult);

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.0rc40.0090.00698.97
7.3.0rc30.0300.00716.78
7.3.0beta10.0120.00612.57
7.2.80.0100.00316.66
7.2.00.0030.01319.51
7.1.200.0040.00715.82
7.1.100.0030.00918.04
7.1.70.0030.00617.23
7.1.60.0030.02019.70
7.1.50.0100.01017.13
7.1.00.0000.08022.52
7.0.200.0200.01016.55
7.0.140.0070.07022.15
7.0.110.0030.06020.10
7.0.100.0130.07719.98
7.0.90.0100.07720.00
7.0.80.0170.07020.11
7.0.70.0070.08320.05
7.0.60.0070.08719.96
7.0.50.0070.08320.41
7.0.40.0170.08020.19
7.0.30.0070.05720.17
7.0.20.0030.08320.18
7.0.10.0100.06720.09
7.0.00.0000.05020.05
5.6.280.0070.07320.79
5.6.260.0100.03720.61
5.6.250.0170.06320.61
5.6.240.0070.07720.71
5.6.230.0000.08720.72
5.6.220.0000.07720.71
5.6.210.0070.08320.68
5.6.200.0130.06721.15
5.6.190.0170.07721.23
5.6.180.0100.07721.09
5.6.170.0100.08021.10
5.6.160.0130.07021.15
5.6.150.0000.09021.20
5.6.140.0130.07721.06
5.6.130.0030.08320.99
5.6.120.0230.04320.95
5.6.110.0130.07721.12
5.6.100.0030.08321.11
5.6.90.0070.05720.93
5.6.80.0000.05020.54
5.6.70.0070.07320.53
5.6.60.0100.07720.30
5.6.50.0130.06720.34
5.6.40.0100.08020.45
5.6.30.0030.08020.51
5.6.20.0030.07720.55
5.6.10.0100.05320.63
5.6.00.0170.06720.47
5.5.380.0130.07320.35
5.5.370.0070.08320.48
5.5.360.0070.08320.32
5.5.350.0130.08020.47
5.5.340.0070.07720.78
5.5.330.0030.08720.86
5.5.320.0130.07021.00
5.5.310.0170.07020.79
5.5.300.0200.06720.88
5.5.290.0070.08020.92
5.5.280.0100.08320.95
5.5.270.0030.08721.02
5.5.260.0030.08020.90
5.5.250.0100.08020.73
5.5.240.0030.08320.43
5.5.230.0030.08320.20
5.5.220.0030.05020.28
5.5.210.0200.06320.29
5.5.200.0000.08020.18
5.5.190.0030.08320.26
5.5.180.0130.07320.30
5.5.160.0100.06720.31
5.5.150.0130.07020.20
5.5.140.0070.04720.34
5.5.130.0130.07320.39
5.5.120.0030.07720.16
5.5.110.0070.07020.09
5.5.100.0100.07020.00
5.5.90.0130.04020.29
5.5.80.0030.06320.14
5.5.70.0030.07720.22
5.5.60.0170.06020.25
5.5.50.0100.06720.04
5.5.40.0070.07320.25
5.5.30.0030.04020.24
5.5.20.0030.04020.21
5.5.10.0070.06320.02
5.5.00.0030.07320.11
5.4.450.0100.04319.27
5.4.440.0100.08719.31
5.4.430.0070.07019.59
5.4.420.0100.08319.32
5.4.410.0130.07319.18
5.4.400.0100.07319.12
5.4.390.0100.04719.12
5.4.380.0030.07719.08
5.4.370.0130.06719.07
5.4.360.0030.08019.03
5.4.350.0100.07019.25
5.4.340.0030.08018.95
5.4.320.0000.06018.93
5.4.310.0000.08019.01
5.4.300.0130.06719.03
5.4.290.0030.08019.02
5.4.280.0130.06319.24
5.4.270.0130.06719.11
5.4.260.0100.07018.92
5.4.250.0070.06019.02
5.4.240.0100.07018.94
5.4.230.0100.06319.00
5.4.220.0030.07719.17
5.4.210.0030.03719.02
5.4.200.0070.06319.26
5.4.190.0070.07018.95
5.4.180.0070.07319.00
5.4.170.0070.03719.06
5.4.160.0000.04019.22
5.4.150.0070.07319.16
5.4.140.0030.06016.20
5.4.130.0130.06716.48
5.4.120.0070.06316.55
5.4.110.0070.07316.39
5.4.100.0000.07016.38
5.4.90.0030.07716.49
5.4.80.0070.06716.13
5.4.70.0070.04316.49
5.4.60.0030.07016.50
5.4.50.0170.06016.45
5.4.40.0030.07716.30
5.4.30.0100.06016.34
5.4.20.0200.05316.34
5.4.10.0000.07716.11
5.4.00.0070.07015.61
5.3.290.0070.06714.57
5.3.280.0070.03314.46
5.3.270.0130.07314.45
5.3.260.0030.08314.51
5.3.250.0100.06314.51
5.3.240.0200.06014.52
5.3.230.0100.03014.52
5.3.220.0070.06314.64
5.3.210.0000.04314.52
5.3.200.0070.03314.53
5.3.190.0030.07714.57
5.3.180.0030.07314.44
5.3.170.0100.07014.62
5.3.160.0070.07014.47
5.3.150.0070.05714.46
5.3.140.0170.06014.64
5.3.130.0000.05314.44
5.3.120.0100.07014.59
5.3.110.0030.06014.35
5.3.100.0030.06013.91
5.3.90.0000.07713.91
5.3.80.0130.05714.10
5.3.70.0070.07313.96
5.3.60.0100.07013.96
5.3.50.0100.07013.81
5.3.40.0070.07013.98
5.3.30.0100.07013.75
5.3.20.0070.07013.72
5.3.10.0030.07013.60
5.3.00.0070.07313.53
5.2.170.0130.05312.16
5.2.160.0000.05712.16
5.2.150.0070.06012.16
5.2.140.0000.07012.16
5.2.130.0070.06012.16
5.2.120.0070.06012.16
5.2.110.0030.06012.16
5.2.100.0130.05712.16
5.2.90.0030.04312.16
5.2.80.0000.07012.16
5.2.70.0070.06012.16
5.2.60.0000.07012.16
5.2.50.0100.05312.16
5.2.40.0100.05312.16
5.2.30.0030.04312.16
5.2.20.0000.06312.16
5.2.10.0070.05712.16
5.2.00.0170.04712.16
5.1.60.0030.05012.16
5.1.50.0030.05712.16
5.1.40.0130.04312.16
5.1.30.0070.05312.16
5.1.20.0100.05012.16
5.1.10.0100.05012.16
5.1.00.0030.05012.16
5.0.50.0030.03312.16
5.0.40.0030.04012.16
5.0.30.0000.07012.16
5.0.20.0000.05012.16
5.0.10.0000.04712.16
5.0.00.0030.06312.16
4.4.90.0030.02312.16
4.4.80.0000.02312.16
4.4.70.0000.03712.16
4.4.60.0000.03312.16
4.4.50.0000.02312.16
4.4.40.0030.05312.16
4.4.30.0030.01712.16
4.4.20.0030.03712.16
4.4.10.0030.02012.16
4.4.00.0030.04012.16
4.3.110.0000.03712.16
4.3.100.0030.03012.16
4.3.90.0070.02312.16
4.3.80.0030.05312.16
4.3.70.0000.03312.16
4.3.60.0000.03712.16
4.3.50.0000.02712.16
4.3.40.0070.04312.16
4.3.30.0000.02012.16
4.3.20.0000.03312.16
4.3.10.0030.03012.16
4.3.00.0000.02712.16