3v4l.org

run code in 300+ PHP versions simultaneously
<?php mb_internal_encoding('UTF-8'); $html = <<< HTML <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Test Page</title> </head> <body> <p>One two Three&nbsp;fourfive six</p> </body> </html> HTML; $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $query = $xpath->query("/html/body"); $body = $dom->saveXML($query->item(0)); echo end(explode("Three four", strip_tags(str_replace('&nbsp;', ' ', $html)))); echo end(explode("Three four", strip_tags(str_replace('&nbsp;', ' ', $body))));

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.0180.00418.68
8.3.50.0110.00822.11
8.3.40.0090.00619.22
8.3.30.0100.00719.06
8.3.20.0000.00819.10
8.3.10.0040.00420.86
8.3.00.0000.00823.98
8.2.180.0200.00316.88
8.2.170.0070.01122.96
8.2.160.0070.00722.79
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00419.95
8.2.110.0100.00022.61
8.2.100.0040.00818.22
8.2.90.0030.00619.60
8.2.80.0080.00018.30
8.2.70.0060.00317.75
8.2.60.0030.00618.40
8.2.50.0040.00418.26
8.2.40.0060.00618.45
8.2.30.0060.00320.30
8.2.20.0060.00318.24
8.2.10.0000.00818.11
8.2.00.0030.00518.11
8.1.280.0080.00825.92
8.1.270.0080.00023.99
8.1.260.0040.01126.35
8.1.250.0030.00628.09
8.1.240.0050.00521.14
8.1.230.0080.00321.20
8.1.220.0030.00518.77
8.1.210.0040.00419.29
8.1.200.0060.00317.48
8.1.190.0060.00317.89
8.1.180.0060.00318.10
8.1.170.0050.00319.21
8.1.160.0000.00719.20
8.1.150.0000.00818.99
8.1.140.0040.00417.76
8.1.130.0030.00318.23
8.1.120.0000.00717.91
8.1.110.0040.00417.86
8.1.100.0000.00817.84
8.1.90.0050.00317.86
8.1.80.0000.00717.88
8.1.70.0030.00317.88
8.1.60.0040.00418.03
8.1.50.0000.00817.76
8.1.40.0030.00617.93
8.1.30.0040.00418.04
8.1.20.0000.00817.91
8.1.10.0040.00417.84
8.1.00.0040.00417.92
8.0.300.0070.00320.50
8.0.290.0050.00318.99
8.0.280.0040.00418.82
8.0.270.0040.00417.63
8.0.260.0000.00717.27
8.0.250.0040.00417.52
8.0.240.0030.00517.48
8.0.230.0070.00317.46
8.0.220.0000.00717.39
8.0.210.0000.00717.31
8.0.200.0030.00317.46
8.0.190.0040.00417.35
8.0.180.0050.00217.38
8.0.170.0030.00617.38
8.0.160.0000.00717.38
8.0.150.0040.00417.30
8.0.140.0030.00517.33
8.0.130.0060.00013.71
8.0.120.0040.00417.14
8.0.110.0000.00817.49
8.0.100.0020.00517.24
8.0.90.0070.00017.26
8.0.80.0030.01317.23
8.0.70.0000.00717.14
8.0.60.0050.00317.14
8.0.50.0040.00417.29
8.0.30.0120.01117.35
8.0.20.0090.01417.57
8.0.10.0000.00817.33
8.0.00.0080.01017.27
7.4.330.0000.00615.09
7.4.320.0000.00616.89
7.4.300.0040.00416.78
7.4.290.0030.00316.88
7.4.280.0080.00016.99
7.4.270.0070.00016.95
7.4.260.0030.00313.67
7.4.250.0000.00817.01
7.4.240.0000.00816.71
7.4.230.0020.00516.80
7.4.220.0030.01717.10
7.4.210.0070.00916.95
7.4.200.0030.00316.94
7.4.190.0080.00017.00
7.4.160.0130.01016.84
7.4.150.0060.01117.40
7.4.140.0110.00817.86
7.4.130.0090.01216.86
7.4.120.0100.01016.90
7.4.110.0070.01016.94
7.4.100.0030.01716.96
7.4.90.0100.00716.86
7.4.80.0090.01219.04
7.4.70.0140.00416.84
7.4.60.0100.00716.89
7.4.50.0000.00416.77
7.4.40.0030.01322.27
7.4.30.0150.00316.68
7.4.00.0080.00414.91
7.3.330.0030.00313.61
7.3.320.0030.00313.57
7.3.310.0030.00616.61
7.3.300.0000.00716.69
7.3.290.0090.00616.70
7.3.280.0120.00616.72
7.3.270.0130.00317.40
7.3.260.0120.00618.24
7.3.250.0060.01316.79
7.3.240.0080.01116.72
7.3.230.0000.01716.79
7.3.210.0080.00916.79
7.3.200.0090.01219.39
7.3.190.0060.01516.74
7.3.180.0070.01016.76
7.3.170.0060.00916.75
7.3.160.0110.00816.71
7.3.120.0070.00714.96
7.2.330.0060.01216.88
7.2.320.0100.01317.07
7.2.310.0110.00717.05
7.2.300.0070.01017.08
7.2.290.0080.00817.14
7.2.60.0070.01017.05
7.2.00.0030.00719.43
7.1.200.0030.00715.96
7.1.100.0070.00718.36
7.1.70.0140.00717.28
7.1.60.0090.01219.40
7.1.50.0180.00717.27
7.1.00.0030.05722.53
7.0.200.0000.00916.79
7.0.140.0100.06722.18
7.0.60.0170.07720.02
7.0.50.0030.05317.97
7.0.40.0130.05720.55
7.0.30.0170.05320.23
7.0.20.0430.07020.14
7.0.10.0000.08720.19
7.0.00.0070.08320.43
5.6.280.0030.07321.31
5.6.210.0070.07320.93
5.6.200.0170.04718.32
5.6.190.0070.08020.43
5.6.180.3270.04020.79
5.6.170.0270.05320.85
5.6.160.0170.07320.68
5.6.150.0000.04318.29
5.6.140.0000.07718.36
5.6.130.0170.07318.26
5.6.120.0070.08721.23
5.6.110.0000.09021.20
5.6.100.0130.05021.12
5.6.90.0030.04021.24
5.6.80.0030.06020.52
5.5.350.0330.07320.56
5.5.340.0070.06318.06
5.5.330.0100.08020.41
5.5.320.0300.03320.48
5.5.310.0370.07320.48
5.5.300.0070.08018.14
5.5.290.0070.08018.05
5.5.280.0100.03320.98
5.5.270.0030.07021.02
5.5.260.0130.07720.97
5.5.250.0070.07320.75
5.5.240.0070.07320.37
5.4.450.0030.04319.60
5.4.440.0070.04019.62
5.4.430.0000.04019.32
5.4.420.0170.04719.52
5.4.410.0030.03719.43
5.4.400.0000.04019.01
5.4.390.0030.03719.29
5.4.380.0000.04018.94
5.4.370.0070.03719.39
5.4.360.0000.04019.29
5.4.350.0130.03019.24
5.4.340.0030.03719.20
5.4.320.0170.03319.15
5.4.310.0030.03719.39
5.4.300.0030.03719.33
5.4.290.0000.04019.29
5.4.280.0030.03719.33
5.4.270.0070.03319.29
5.4.260.0000.04319.33
5.4.250.0030.06319.31
5.4.240.0100.03719.28
5.4.230.0030.05319.24
5.4.220.0070.07719.29
5.4.210.0130.03718.95
5.4.200.0100.05719.32
5.4.190.0030.05719.29
5.4.180.0030.06318.95
5.4.170.0030.05018.95
5.4.160.0070.05019.13
5.4.150.0100.07319.37
5.4.140.0030.04016.48
5.4.130.0000.04316.54
5.4.120.0170.06716.56
5.4.110.0170.05716.40
5.4.100.0100.06016.50
5.4.90.0130.05316.52
5.4.80.0130.06016.58
5.4.70.0100.06016.59
5.4.60.0030.06316.52
5.4.50.0070.06016.77
5.4.40.0070.07716.48
5.4.30.0100.04716.57
5.4.20.0070.06316.58
5.4.10.0130.04316.37
5.4.00.0030.05715.92
5.3.290.0000.04314.75
5.3.280.0030.04314.70
5.3.270.0000.05714.68
5.3.260.0100.04014.69
5.3.250.0070.04314.71
5.3.240.0070.04314.76
5.3.230.0030.05014.64
5.3.220.0100.03714.64
5.3.210.0130.07014.66
5.3.200.0130.03314.68
5.3.190.0070.04714.60
5.3.180.0030.04314.69
5.3.170.0070.05714.61
5.3.160.0100.04314.61
5.3.150.0200.06714.71
5.3.140.0070.04314.65
5.3.130.0070.04714.67
5.3.120.0100.04714.63
5.3.110.0170.03714.64
5.3.100.0070.07314.13
5.3.90.0070.05314.17
5.3.80.0070.05714.14
5.3.70.0000.04014.11
5.3.60.0030.05314.18
5.3.50.0030.03714.05
5.3.40.0130.04314.09
5.3.30.0000.04014.03
5.3.20.0130.06713.78
5.3.10.0170.03313.80
5.3.00.0130.06713.79
5.2.170.0030.03011.27
5.2.160.0000.03711.17
5.2.150.0030.03311.28
5.2.140.0000.04311.20
5.2.130.0000.03711.16
5.2.120.0070.02711.26
5.2.110.0130.03711.27
5.2.100.0070.02711.22
5.2.90.0030.03011.16
5.2.80.0030.03011.29
5.2.70.0000.04011.12
5.2.60.0000.06711.34
5.2.50.0170.05011.15
5.2.40.0000.03711.19
5.2.30.0100.06311.04
5.2.20.0030.06311.16
5.2.10.0030.03011.07
5.2.00.0070.04310.93
5.1.60.0030.05710.20
5.1.50.0030.04310.14
5.1.40.0000.05710.13
5.1.30.0030.03310.54
5.1.20.0030.03310.53
5.1.10.0030.06010.21
5.1.00.0030.05710.32
5.0.50.0070.0278.72
5.0.40.0030.0238.61
5.0.30.0000.0408.57
5.0.20.0000.0508.57
5.0.10.0000.0238.57
5.0.00.0000.0608.57
4.4.90.0000.0178.57
4.4.80.0070.0308.57
4.4.70.0000.0278.57
4.4.60.0030.0378.57
4.4.50.0000.0378.57
4.4.40.0070.0538.57
4.4.30.0100.0108.57
4.4.20.0070.0278.57
4.4.10.0030.0238.57
4.4.00.0030.0308.57
4.3.110.0030.0378.57
4.3.100.0030.0208.57
4.3.90.0030.0338.57
4.3.80.0030.0408.57
4.3.70.0030.0308.57
4.3.60.0030.0208.57
4.3.50.0000.0208.57
4.3.40.0030.0238.57
4.3.30.0000.0208.57
4.3.20.0030.0238.57
4.3.10.0030.0378.57
4.3.00.0000.0178.57

preferences:
37.7 ms | 401 KiB | 5 Q