3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Get real file from code id */ // nl2p // This function will convert newlines to HTML paragraphs // without paying attention to HTML tags. Feed it a raw string and it will // simply return that string sectioned into HTML paragraphs function nl2p($str) { $arr=explode("\n",$str); $out=''; for($i=0;$i<count($arr);$i++) { if(strlen(trim($arr[$i]))>0) $out.='<p>'.trim($arr[$i]).'</p>'; } return $out; } // nl2p_html // This function will add paragraph tags around textual content of an HTML file, leaving // the HTML itself intact // This function assumes that the HTML syntax is correct and that the '<' and '>' characters // are not used in any of the values for any tag attributes. If these assumptions are not met, // mass paragraph chaos may ensue. Be safe. function nl2p_html($str) { // If we find the end of an HTML header, assume that this is part of a standard HTML file. Cut off everything including the // end of the head and save it in our output string, then trim the head off of the input. This is mostly because we don't // want to surrount anything like the HTML title tag or any style or script code in paragraph tags. if(strpos($str,'</head>')!==false) { $out=substr($str,0,strpos($str,'</head>')+7); $str=substr($str,strpos($str,'</head>')+7); } } // test $string = "Submissions found to be in violation of these rules may be removed and the author's account suspended at the discretion of the site administrators and/or moderators. The site administrators reserve the right to modify these rules as needed."; $para = nl2p($string); echo $para; ?>

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.60.0080.00816.77
7.2.00.0030.01419.54
7.1.200.0060.00615.96
7.1.100.0040.00718.14
7.1.70.0030.00317.37
7.1.60.0140.01119.25
7.1.50.0190.01534.64
7.1.00.0070.07022.40
7.0.200.0740.00914.83
7.0.140.0030.07721.97
7.0.120.0070.07022.08
7.0.60.0070.07319.86
7.0.50.0070.08317.84
7.0.40.0030.04720.24
7.0.30.0430.04020.02
7.0.20.0270.08320.06
7.0.10.0070.09020.08
7.0.00.0030.08720.09
5.6.210.0130.06020.66
5.6.200.0100.08018.29
5.6.190.0130.07720.67
5.6.180.3700.04720.54
5.6.170.0200.04320.55
5.6.160.0030.09020.39
5.6.150.0100.07318.18
5.6.140.0030.04318.24
5.6.130.0030.06718.14
5.6.120.0030.06721.03
5.6.110.0070.05020.98
5.6.100.0100.08320.99
5.6.90.0100.05021.11
5.6.80.0070.06020.36
5.6.70.2370.06320.36
5.5.350.0100.05720.41
5.5.340.0070.08317.96
5.5.330.0070.08720.36
5.5.320.0300.07320.35
5.5.310.0270.06020.41
5.5.300.0030.08717.94
5.5.290.0030.04017.95
5.5.280.0070.08320.78
5.5.270.0070.08020.69
5.5.260.0070.08720.78
5.5.250.0000.08320.72
5.5.240.0070.07320.20
5.4.450.0100.07319.48
5.4.440.0070.07019.48
5.4.430.0070.08319.30
5.4.420.0030.07719.57
5.4.410.0100.07719.35
5.4.400.0170.06718.85
5.4.390.0170.07319.24
5.4.380.0130.03719.01
5.4.370.0070.04319.16
5.4.360.0100.07319.18
5.4.350.0130.07019.29
5.4.340.0030.05719.24
5.4.320.0070.07719.12
5.4.310.0170.05018.87
5.4.300.0030.06719.24
5.4.290.0200.07019.26
5.4.280.0130.03719.14
5.4.270.0100.06019.14
5.4.260.0000.06019.25
5.4.250.0130.06719.00
5.4.240.0000.07019.07
5.4.230.0070.07319.23
5.4.220.0000.05319.07
5.4.210.0100.06319.23
5.4.200.0070.04718.87
5.4.190.0030.04319.11
5.4.180.0070.07019.11
5.4.170.0070.04318.85
5.4.160.0100.06318.90
5.4.150.0070.06319.14
5.4.140.0100.05716.38
5.4.130.0100.04716.39
5.4.120.0130.06716.48
5.4.110.0130.03016.46
5.4.100.0070.04016.48
5.4.90.0100.03016.48
5.4.80.0130.06716.46
5.4.70.0100.05316.51
5.4.60.0070.06016.36
5.4.50.0000.05316.36
5.4.40.0070.03316.45
5.4.30.0070.03716.36
5.4.20.0070.05716.50
5.4.10.0100.04316.34
5.4.00.0070.07015.84
5.3.290.0070.07314.73
5.3.280.0070.03314.52
5.3.270.0000.04714.50
5.3.260.0030.03714.77
5.3.250.0000.04014.64
5.3.240.0100.04314.63
5.3.230.0070.06714.59
5.3.220.0100.05714.58
5.3.210.0070.07714.58
5.3.200.0130.06014.58
5.3.190.0070.04014.60
5.3.180.0070.04314.63
5.3.170.0070.04714.49
5.3.160.0130.05314.58
5.3.150.0070.07314.57
5.3.140.0030.05714.58
5.3.130.0000.04014.55
5.3.120.0000.04014.56
5.3.110.0000.06314.47
5.3.100.0030.07714.09
5.3.90.0030.05313.95
5.3.80.0030.06714.05
5.3.70.0100.06714.02
5.3.60.0100.07014.05
5.3.50.0070.05714.00
5.3.40.0070.03714.01
5.3.30.0100.05713.95
5.3.20.0030.05313.59
5.3.10.0030.05013.66
5.3.00.0030.08013.57
5.2.170.0100.05711.20
5.2.160.0030.05011.17
5.2.150.0070.06011.20
5.2.140.0070.04311.11
5.2.130.0030.06711.27
5.2.120.0000.04311.11
5.2.110.0030.06011.07
5.2.100.0000.04711.26
5.2.90.0070.02711.14
5.2.80.0100.05711.12
5.2.70.0070.06311.16
5.2.60.0100.05711.20
5.2.50.0000.06711.08
5.2.40.0030.03711.06
5.2.30.0030.04710.95
5.2.20.0000.03310.93
5.2.10.0000.04310.82
5.2.00.0030.02710.69
5.1.60.0070.05010.00
5.1.50.0070.0509.98
5.1.40.0000.02710.13
5.1.30.0030.05710.39
5.1.20.0100.02710.36
5.1.10.0030.02710.07
5.1.00.0000.02710.08
5.0.50.0000.0338.55
5.0.40.0000.0278.57
5.0.30.0000.0578.25
5.0.20.0000.0438.35
5.0.10.0070.0378.09
5.0.00.0000.0678.08
4.4.90.0030.0237.82
4.4.80.0000.0377.82
4.4.70.0000.0377.82
4.4.60.0070.0177.82
4.4.50.0030.0237.82
4.4.40.0000.0377.82
4.4.30.0000.0207.82
4.4.20.0030.0277.82
4.4.10.0130.0137.82
4.4.00.0000.0577.82
4.3.110.0030.0377.82
4.3.100.0000.0237.82
4.3.90.0130.0237.82
4.3.80.0030.0437.82
4.3.70.0030.0177.82
4.3.60.0030.0137.82
4.3.50.0000.0177.82
4.3.40.0000.0237.82
4.3.30.0000.0307.82
4.3.20.0000.0377.82
4.3.10.0000.0307.82
4.3.00.0030.0307.82