3v4l.org

run code in 300+ PHP versions simultaneously
<?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).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0110.00416.38
8.3.50.0100.00717.45
8.3.40.0160.00318.80
8.3.30.0000.01418.63
8.3.20.0080.00018.48
8.3.10.0080.00018.60
8.3.00.0000.00819.38
8.2.180.0040.01118.28
8.2.170.0110.00322.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0000.00720.95
8.2.110.0060.00320.35
8.2.100.0110.00018.34
8.2.90.0030.00619.18
8.2.80.0040.00418.22
8.2.70.0030.00617.63
8.2.60.0040.00417.80
8.2.50.0050.00317.90
8.2.40.0050.00319.35
8.2.30.0000.00917.88
8.2.20.0000.01017.70
8.2.10.0070.00017.76
8.2.00.0070.00317.71
8.1.280.0110.00725.92
8.1.270.0060.00323.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00022.06
8.1.230.0090.00317.89
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0040.00417.62
8.1.160.0000.00719.02
8.1.150.0000.00718.64
8.1.140.0030.00517.36
8.1.130.0030.00317.53
8.1.120.0040.00417.49
8.1.110.0060.00317.47
8.1.100.0030.00317.49
8.1.90.0000.00817.38
8.1.80.0040.00417.48
8.1.70.0040.00417.47
8.1.60.0000.00817.55
8.1.50.0040.00417.45
8.1.40.0060.00317.40
8.1.30.0040.00417.55
8.1.20.0000.00817.63
8.1.10.0040.00417.50
8.1.00.0000.00817.59
8.0.300.0000.00718.77
8.0.290.0030.00616.75
8.0.280.0050.00318.59
8.0.270.0040.00317.27
8.0.260.0030.00316.80
8.0.250.0000.00716.96
8.0.240.0070.00316.89
8.0.230.0070.00016.97
8.0.220.0070.00016.88
8.0.210.0000.00716.95
8.0.200.0060.00016.96
8.0.190.0030.00516.95
8.0.180.0000.00716.83
8.0.170.0060.00316.93
8.0.160.0000.00716.82
8.0.150.0070.00316.89
8.0.140.0000.00816.89
8.0.130.0030.00313.38
8.0.120.0100.00016.90
8.0.110.0040.00416.68
8.0.100.0070.00016.94
8.0.90.0050.00216.84
8.0.80.0070.01416.80
8.0.70.0040.00416.93
8.0.60.0030.00616.76
8.0.50.0040.00416.81
8.0.30.0110.00617.11
8.0.20.0090.01116.98
8.0.10.0040.00416.89
8.0.00.0100.00716.82
7.4.330.0000.00513.00
7.4.320.0000.00716.62
7.4.300.0030.00316.54
7.4.290.0000.00716.61
7.4.280.0070.00016.54
7.4.270.0030.00316.66
7.4.260.0050.00013.21
7.4.250.0040.00416.50
7.4.240.0030.00316.58
7.4.230.0080.00016.64
7.4.220.0120.00616.61
7.4.210.0100.01016.63
7.4.200.0000.00716.43
7.4.190.0050.00316.79
7.4.160.0070.01016.63
7.4.150.0100.00716.69
7.4.140.0070.01117.86
7.4.130.0130.00616.48
7.4.120.0140.01016.57
7.4.110.0140.01016.56
7.4.100.0120.00916.48
7.4.90.0100.00716.57
7.4.80.0180.00619.39
7.4.70.0130.00616.51
7.4.60.0070.01116.39
7.4.50.0030.00616.54
7.4.40.0090.00516.49
7.4.30.0100.00716.55
7.4.00.0070.01014.75
7.3.330.0060.00013.32
7.3.320.0050.00013.13
7.3.310.0030.00316.20
7.3.300.0040.00416.32
7.3.290.0050.00816.30
7.3.280.0110.00316.30
7.3.270.0100.00716.39
7.3.260.0060.01116.38
7.3.240.0070.01016.51
7.3.230.0090.00916.39
7.3.210.0100.00716.29
7.3.200.0190.00316.51
7.3.190.0140.00916.65
7.3.180.0150.00016.40
7.3.170.0070.01216.53
7.3.160.0060.00916.61
7.3.120.0070.00714.98
7.2.330.0060.01216.69
7.2.320.0100.01016.75
7.2.310.0070.01016.79
7.2.300.0040.01216.50
7.2.290.0030.01416.74
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

preferences:
41.79 ms | 401 KiB | 5 Q