3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div> <img src="icons/example.svg"> <a href="http://www.example.com">a link</a> <link href="css/example.css"> <iframe src="http://www.example.com/default.htm"></iframe> </div> HTML; $dom = new DOMDocument(); $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); foreach ($xpath->query('//img/@src | //link/@href') as $attr) { $attr->value = "{{asset('" . $attr->value . ")'}}"; } echo substr($dom->saveXML(), 38); // remove the auto-generated xml tag from the start

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.0150.00017.13
8.3.50.0000.01518.65
8.3.40.0160.00019.68
8.3.30.0070.00719.39
8.3.20.0030.00624.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.180.0110.00425.92
8.2.170.0110.00422.96
8.2.160.0080.00522.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00426.35
8.2.110.0140.00022.75
8.2.100.0060.00618.09
8.2.90.0030.00517.88
8.2.80.0060.00318.13
8.2.70.0050.00318.13
8.2.60.0030.00618.00
8.2.50.0040.00418.05
8.2.40.0040.00418.41
8.2.30.0040.00418.32
8.2.20.0040.00418.43
8.2.10.0000.00719.63
8.2.00.0070.00019.74
8.1.280.0070.01425.92
8.1.270.0000.00823.99
8.1.260.0040.00428.09
8.1.250.0110.00428.09
8.1.240.0060.00324.21
8.1.230.0070.00419.47
8.1.220.0090.00018.03
8.1.210.0000.01018.77
8.1.200.0030.00717.60
8.1.190.0040.00417.63
8.1.180.0030.00618.10
8.1.170.0000.00817.72
8.1.160.0040.00422.55
8.1.150.0040.00419.32
8.1.140.0080.00019.31
8.1.130.0030.00320.54
8.1.120.0000.00717.79
8.1.110.0070.00017.84
8.1.100.0000.00717.77
8.1.90.0040.00417.90
8.1.80.0000.00817.79
8.1.70.0000.00817.88
8.1.60.0040.00418.01
8.1.50.0080.00017.96
8.1.40.0040.00417.92
8.1.30.0040.00418.12
8.1.20.0040.00417.97
8.1.10.0000.00818.01
8.1.00.0050.00317.88
8.0.300.0020.00520.15
8.0.290.0000.00817.13
8.0.280.0000.00818.79
8.0.270.0040.00418.36
8.0.260.0000.00820.65
8.0.250.0000.00717.45
8.0.240.0000.00717.39
8.0.230.0050.00217.33
8.0.220.0070.00017.23
8.0.210.0030.00317.23
8.0.200.0000.00717.43
8.0.190.0040.00417.31
8.0.180.0050.00317.39
8.0.170.0060.00317.29
8.0.160.0040.00417.44
8.0.150.0040.00417.29
8.0.140.0040.00417.28
8.0.130.0000.00613.72
8.0.120.0040.00417.34
8.0.110.0040.00417.33
8.0.100.0040.00417.41
8.0.90.0000.00917.26
8.0.80.0090.00617.36
8.0.70.0000.00817.45
8.0.60.0030.00517.05
8.0.50.0000.00817.27
8.0.30.0070.01117.55
8.0.20.0120.01817.42
8.0.10.0070.00017.36
8.0.00.0030.01517.16
7.4.330.0050.00015.55
7.4.320.0030.00316.96
7.4.300.0030.00317.04
7.4.290.0030.00316.83
7.4.280.0000.00916.96
7.4.270.0030.00316.86
7.4.260.0030.00313.61
7.4.250.0000.00716.77
7.4.240.0020.00616.97
7.4.230.0100.00016.87
7.4.220.0040.00316.95
7.4.210.0060.01017.01
7.4.200.0050.00316.93
7.4.130.0100.00816.76
7.4.120.0180.00316.86
7.4.110.0090.00916.80
7.4.100.0030.02016.79
7.4.90.0150.00317.00
7.4.80.0090.00919.39
7.4.70.0140.00317.07
7.4.60.0050.01116.60
7.4.50.0060.01216.83
7.4.40.0050.01316.64
7.4.30.0140.00917.00
7.4.20.0100.00616.76
7.4.10.0060.01116.79
7.4.00.0120.00416.87
7.3.330.0030.00316.48
7.3.320.0000.00613.57
7.3.310.0030.00316.61
7.3.300.0000.00716.75
7.3.290.0090.00716.66
7.3.260.0190.00616.82
7.3.240.0100.01016.82
7.3.230.0100.00716.75
7.3.210.0080.01116.65
7.3.200.0030.01316.79
7.3.190.0040.01316.91
7.3.180.0080.00816.76
7.3.170.0070.01016.60
7.3.160.0090.00916.70
7.3.150.0150.00716.58
7.3.140.0130.00616.80
7.3.130.0100.00716.71
7.3.120.0150.00616.66
7.3.110.0150.00316.65
7.3.100.0050.01216.70
7.3.90.0100.00516.69
7.3.80.0060.00916.61
7.3.70.0070.01016.49
7.3.60.0070.01016.43
7.3.50.0100.00716.67
7.3.40.0130.00316.64
7.3.30.0130.00316.66
7.3.20.0120.00316.67
7.3.10.0130.00316.74
7.3.00.0090.00916.65
7.2.330.0100.01016.97
7.2.320.0060.01217.00
7.2.310.0170.00016.93
7.2.300.0120.00816.93
7.2.290.0170.00016.83
7.2.280.0000.02016.98
7.2.270.0110.01117.00
7.2.260.0110.00616.88
7.2.250.0140.00616.73
7.2.240.0060.01017.15
7.2.230.0070.01016.60
7.2.220.0000.01717.03
7.2.210.0100.00617.00
7.2.200.0110.00716.82
7.2.190.0070.01016.71
7.2.180.0140.00617.02
7.2.170.0090.00616.86
7.2.160.0050.01116.86
7.2.150.0120.00416.92
7.2.140.0150.00316.99
7.2.130.0410.00716.86
7.2.120.0160.00316.96
7.2.110.0110.00616.96
7.2.100.0070.01017.08
7.2.90.0130.00516.95
7.2.80.0120.00816.92
7.2.70.0090.00916.88
7.2.60.0090.01117.04
7.2.50.0120.00616.73
7.2.40.0050.01416.81
7.2.30.0090.00916.80
7.2.20.0120.01216.98
7.2.10.0130.00316.91
7.2.00.0060.01016.65

preferences:
59.11 ms | 400 KiB | 5 Q