3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $s = 'Happy^ hour^ / is fun //'; function filenameEncode($possible_filename){ $fngood = str_replace(array('^',';','/',':'), array('^^',';;','^',';'), $possible_filename); return $fngood; } function filenameDecode($possible_filename){ $fngood = str_replace(array('^',';','^^',';;'), array('^',';','/',':'), $possible_filename); return $fngood; } echo $s."\n"; $t = filenameEncode($s); $u = filenameDecode($t); echo $t."\n"; echo $u."\n"; if ($s === $u){ echo 'test passed'; }

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.0030.00919.39
7.1.100.0060.00917.96
7.1.70.0000.00816.93
7.1.60.0060.01819.40
7.1.50.0070.01317.01
7.1.00.0000.07722.31
7.0.200.0060.00614.91
7.0.140.0070.07022.18
7.0.120.0070.05322.15
7.0.60.0100.08019.93
7.0.50.0000.05317.82
7.0.40.0070.08017.84
7.0.30.0070.08717.75
7.0.20.0070.06017.80
7.0.10.0070.08717.80
7.0.00.0070.05317.84
5.6.280.0070.07021.10
5.6.210.0030.04720.57
5.6.200.0100.05018.21
5.6.190.0070.07318.15
5.6.180.0100.05018.28
5.6.170.0100.05718.29
5.6.160.0000.05018.30
5.6.150.0030.08318.19
5.6.140.0000.05018.15
5.6.130.0100.04718.28
5.6.120.0070.04318.27
5.6.110.0070.06718.26
5.6.100.0170.07018.27
5.6.90.0100.05018.20
5.6.80.0000.05017.64
5.6.70.0100.06317.53
5.6.60.0100.06317.53
5.6.50.0000.07017.51
5.6.40.0070.07017.53
5.6.30.0030.07017.54
5.6.20.0130.03317.58
5.6.10.0070.07017.64
5.6.00.0030.04017.53
5.5.350.0300.05020.50
5.5.340.0070.06017.95
5.5.330.0070.04318.05
5.5.320.0030.08317.98
5.5.310.0030.09017.92
5.5.300.0130.04317.98
5.5.290.0030.05018.04
5.5.280.0070.08718.05
5.5.270.0070.08017.97
5.5.260.0130.07717.97
5.5.250.0070.06317.77
5.5.240.0030.08017.37
5.5.230.0130.07317.34
5.5.220.0070.03717.33
5.5.210.0130.03017.33
5.5.200.0030.07717.30
5.5.190.0030.07317.30
5.5.180.0130.03017.30
5.5.160.0030.07717.29
5.5.150.0100.07317.30
5.5.140.0030.08317.39
5.5.130.0100.03317.34
5.5.120.0030.04717.35
5.5.110.0070.08317.30
5.5.100.0100.05717.21
5.5.90.0030.07317.23
5.5.80.0000.06017.26
5.5.70.0000.08317.21
5.5.60.0070.07017.22
5.5.50.0030.07017.26
5.5.40.0100.04317.22
5.5.30.0100.07317.20
5.5.20.0070.06317.19
5.5.10.0070.08017.25
5.5.00.0100.07717.26
5.4.450.0070.06319.38
5.4.440.0030.06019.46
5.4.430.0030.08019.42
5.4.420.0070.05019.45
5.4.410.0100.07019.25
5.4.400.0100.06319.28
5.4.390.0170.07019.27
5.4.380.0000.05019.01
5.4.370.0070.07019.03
5.4.360.0100.04019.04
5.4.350.0070.06318.98
5.4.340.0030.06719.02
5.4.320.0100.04019.05
5.4.310.0100.07019.05
5.4.300.0100.03019.26
5.4.290.0070.04018.95
5.4.280.0070.08019.14
5.4.270.0070.07019.12
5.4.260.0130.07019.03
5.4.250.0100.07319.27
5.4.240.0030.08019.04
5.4.230.0100.07019.04
5.4.220.0070.07319.02
5.4.210.0070.05019.04
5.4.200.0070.05019.05
5.4.190.0100.06318.95
5.4.180.0170.07019.08
5.4.170.0070.04719.04
5.4.160.0030.06019.04
5.4.150.0100.04319.03
5.4.140.0070.07316.29
5.4.130.0100.06716.40
5.4.120.0100.04316.34
5.4.110.0130.06316.51
5.4.100.0030.06316.50
5.4.90.0100.05716.45
5.4.80.0070.05016.49
5.4.70.0000.04016.61
5.4.60.0070.05016.43
5.4.50.0070.07016.43
5.4.40.0030.04316.45
5.4.30.0000.04716.45
5.4.20.0000.05316.34
5.4.10.0070.06016.37
5.4.00.0070.07015.82
5.3.290.0070.04314.69
5.3.280.0000.06714.62
5.3.270.0130.07314.63
5.3.260.0030.08014.58
5.3.250.0100.03314.57
5.3.240.0070.04314.67
5.3.230.0070.07714.61
5.3.220.0030.08014.57
5.3.210.0070.07714.58
5.3.200.0100.05014.61
5.3.190.0100.07314.64
5.3.180.0130.06014.62
5.3.170.0000.05014.64
5.3.160.0030.04314.58
5.3.150.0230.04714.62
5.3.140.0000.07314.56
5.3.130.0070.04714.52
5.3.120.0130.03014.62
5.3.110.0130.07314.41
5.3.100.0100.05714.08
5.3.90.0070.07714.02
5.3.80.0130.05014.08
5.3.70.0000.07314.07
5.3.60.0100.07314.05
5.3.50.0070.06313.85
5.3.40.0070.07013.97
5.3.30.0000.06713.96
5.3.20.0100.07013.75
5.3.10.0070.07013.76
5.3.00.0130.03713.66
5.2.170.0070.05711.19
5.2.160.0130.05711.25
5.2.150.0070.06011.06
5.2.140.0030.06311.14
5.2.130.0000.05011.07
5.2.120.0070.05311.10
5.2.110.0030.06311.12
5.2.100.0000.03711.16
5.2.90.0030.03011.20
5.2.80.0030.05711.17
5.2.70.0030.04011.31
5.2.60.0030.03711.07
5.2.50.0030.03311.04
5.2.40.0070.06011.08
5.2.30.0100.05710.94
5.2.20.0000.06311.06
5.2.10.0070.05310.93
5.2.00.0000.04710.74
5.1.60.0000.04010.05
5.1.50.0000.0579.98
5.1.40.0130.03010.01
5.1.30.0070.05310.34
5.1.20.0030.05310.37
5.1.10.0130.0479.93
5.1.00.0100.02010.15
5.0.50.0030.0478.60
5.0.40.0030.0478.40
5.0.30.0000.0708.29
5.0.20.0000.0308.16
5.0.10.0070.0438.14
5.0.00.0030.0578.17
4.4.90.0000.0407.70
4.4.80.0000.0337.70
4.4.70.0030.0137.70
4.4.60.0030.0137.70
4.4.50.0130.0177.70
4.4.40.0000.0277.70
4.4.30.0000.0377.70
4.4.20.0000.0177.70
4.4.10.0030.0337.70
4.4.00.0000.0607.70
4.3.110.0030.0337.70
4.3.100.0000.0237.70
4.3.90.0030.0337.70
4.3.80.0000.0377.70
4.3.70.0000.0177.70
4.3.60.0000.0177.70
4.3.50.0000.0177.70
4.3.40.0030.0307.70
4.3.30.0030.0137.70
4.3.20.0000.0177.70
4.3.10.0000.0177.70
4.3.00.0000.0177.70