3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'foo o a a'; $str = preg_replace('/\s+/', '', $str); // This will be 'foo o' now echo $str;
based on 1FfGH

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.2.00.0070.00719.61
7.1.100.0070.01018.20
7.1.70.0040.01117.49
7.1.60.0100.01419.50
7.1.50.0100.01416.84
7.1.00.0000.07722.45
7.0.200.0000.01014.90
7.0.140.0030.04321.95
7.0.60.0070.08719.96
7.0.50.0170.07017.68
7.0.40.0230.07020.00
7.0.30.0530.06720.31
7.0.20.0100.04720.18
7.0.10.0130.08320.03
7.0.00.0130.03720.19
5.6.280.0070.07021.01
5.6.210.0030.08020.73
5.6.200.0030.04318.09
5.6.190.0070.04320.32
5.6.180.0230.04320.63
5.6.170.0270.07720.50
5.6.160.0070.08020.71
5.6.150.0070.03718.16
5.6.140.0070.07318.16
5.6.130.0070.07018.21
5.6.120.0130.08021.14
5.6.110.0030.07720.96
5.6.100.0100.06720.97
5.6.90.0070.08720.94
5.6.80.0100.07020.40
5.5.350.0230.07720.38
5.5.340.0170.07018.02
5.5.330.0030.06320.13
5.5.320.0270.07720.18
5.5.310.0100.04720.30
5.5.300.0030.05018.00
5.5.290.0100.07717.88
5.5.280.0070.07320.86
5.5.270.0070.04720.79
5.5.260.0100.03320.75
5.5.250.0030.06320.68
5.5.240.0000.06320.25
5.4.450.0570.05319.54
5.4.440.0770.05719.63
5.4.430.0670.06319.58
5.4.420.0700.05719.45
5.4.410.0170.05718.91
5.4.400.0870.07018.73
5.4.390.1570.06018.73
5.4.380.1070.05018.46
5.4.370.0970.05018.47
5.4.360.0870.07018.55
5.4.350.0830.07018.55
5.4.340.1200.07018.72
5.4.320.1330.04018.70
5.4.310.0870.06718.71
5.4.300.1400.06018.63
5.4.290.1230.06018.76
5.4.280.1370.06318.42
5.4.270.1300.05718.55
5.4.260.1430.06018.43
5.4.250.1400.06318.47
5.4.240.7200.05018.57
5.4.230.1100.06018.57
5.4.220.1200.05718.69
5.4.210.1130.05718.49
5.4.200.1170.05316.62
5.4.190.1270.05018.46
5.4.180.1100.06318.41
5.4.170.5500.05718.68
5.4.160.0970.06018.65
5.4.150.1200.04318.45
5.4.140.0970.07316.17
5.4.130.1130.05716.13
5.4.120.1170.05316.26
5.4.110.1100.06316.34
5.4.100.1270.06316.32
5.4.90.1300.06016.23
5.4.80.1200.06016.02
5.4.70.5930.05316.24
5.4.60.1070.06016.01
5.4.50.1100.06316.03
5.4.40.1070.06016.11
5.4.30.1130.05016.02
5.4.20.4000.05316.13
5.4.10.0970.06716.28
5.4.00.0930.05015.70
5.3.290.1070.05714.71
5.3.280.0970.06014.66
5.3.270.1000.07314.55
5.3.260.0930.07014.56
5.3.250.1230.04714.53
5.3.240.1200.05014.55
5.3.230.4730.05714.59
5.3.220.1370.07014.49
5.3.210.1170.05714.57
5.3.200.1170.05014.49
5.3.190.1200.05314.63
5.3.180.1100.06714.67
5.3.170.1400.05014.65
5.3.160.1200.05014.56
5.3.150.1300.05714.54
5.3.140.4530.06014.45
5.3.130.1070.05314.47
5.3.120.1070.07314.54
5.3.110.1300.06014.64
5.3.100.1130.05714.07
5.3.90.1000.05713.95
5.3.80.0900.06013.98
5.3.70.1170.04013.96
5.3.60.1400.05313.96
5.3.50.1130.06313.92
5.3.40.3330.05013.92
5.3.30.1030.05313.94
5.3.20.0970.05713.67
5.3.10.1000.05313.64
5.3.00.0930.06013.53
5.2.170.0770.05711.28
5.2.160.1000.04011.27
5.2.150.1100.04711.27
5.2.140.0970.05311.07
5.2.130.3330.04011.17
5.2.120.0800.04011.13
5.2.110.0870.04711.07
5.2.100.0900.03711.08
5.2.90.0770.04311.10
5.2.80.0770.05011.05
5.2.70.0870.04011.09
5.2.60.1030.06010.99
5.2.50.0730.04710.97
5.2.40.0800.04710.91
5.2.30.0700.05710.95
5.2.20.0670.04011.07
5.2.10.0800.04010.95
5.2.00.0730.05710.72
5.1.60.0570.0439.99
5.1.50.0730.03010.04
5.1.40.0570.0409.99
5.1.30.0630.04010.32
5.1.20.0700.03710.31
5.1.10.0630.03310.13
5.1.00.3300.03310.08
5.0.50.0400.0338.65
5.0.40.0330.0278.42
5.0.30.0370.0438.33
5.0.20.0330.0278.21
5.0.10.0400.0238.16
5.0.00.0500.0438.27
4.4.90.0300.0275.88
4.4.80.0400.0205.91
4.4.70.0400.0205.91
4.4.60.0230.0335.91
4.4.50.0430.0305.90
4.4.40.2330.0375.88
4.4.30.0330.0275.92
4.4.20.0430.0335.96
4.4.10.0370.0235.93
4.4.00.0330.0405.84
4.3.110.0370.0235.87
4.3.100.0330.0205.83
4.3.90.0300.0275.89
4.3.80.0430.0335.78
4.3.70.0570.0175.77
4.3.60.0370.0335.76
4.3.50.0470.0275.81
4.3.40.0330.0305.75
4.3.30.0500.0274.67
4.3.20.0270.0274.51
4.3.10.0230.0174.54
4.3.00.0000.0236.76