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; $doc = new DOMDocument(); $doc->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $doc->substituteEntities = false; $xpath = new DOMXPath($doc); foreach ($xpath->query('//img/@src | //link/@href') as $attr) { $attr->value = "{{asset('" . $attr->value . ")'}}"; } echo $doc->saveHTML();

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.93
8.3.50.0120.00918.27
8.3.40.0000.01519.59
8.3.30.0090.00619.31
8.3.20.0080.00024.18
8.3.10.0000.00824.66
8.3.00.0000.00826.16
8.2.180.0040.01125.92
8.2.170.0120.00322.96
8.2.160.0030.01022.96
8.2.150.0060.00325.66
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00026.35
8.2.110.0000.00920.75
8.2.100.0060.00617.97
8.2.90.0040.00418.00
8.2.80.0030.00618.86
8.2.70.0040.00417.88
8.2.60.0030.00617.75
8.2.50.0080.00018.05
8.2.40.0040.00418.47
8.2.30.0040.00418.51
8.2.20.0000.00918.41
8.2.10.0040.00419.66
8.2.00.0000.00819.81
8.1.280.0180.00425.92
8.1.270.0090.00023.99
8.1.260.0040.00428.09
8.1.250.0090.00628.09
8.1.240.0100.00019.39
8.1.230.0040.00723.03
8.1.220.0040.00418.86
8.1.210.0040.00418.77
8.1.200.0000.00817.90
8.1.190.0040.00417.38
8.1.180.0080.00018.10
8.1.170.0100.00017.72
8.1.160.0080.00022.50
8.1.150.0070.00019.12
8.1.140.0000.00719.17
8.1.130.0000.00720.37
8.1.120.0000.00917.69
8.1.110.0040.00417.73
8.1.100.0030.00517.66
8.1.90.0030.00417.76
8.1.80.0040.00417.82
8.1.70.0000.00817.79
8.1.60.0050.00317.95
8.1.50.0000.00917.81
8.1.40.0040.00417.91
8.1.30.0000.00818.01
8.1.20.0000.00817.86
8.1.10.0040.00417.77
8.1.00.0040.00417.73
8.0.300.0040.00418.77
8.0.290.0000.00817.13
8.0.280.0000.00718.89
8.0.270.0030.00518.43
8.0.260.0000.00720.51
8.0.250.0030.00317.36
8.0.240.0000.00817.33
8.0.230.0030.00317.36
8.0.220.0040.00417.20
8.0.210.0070.00017.29
8.0.200.0000.00717.36
8.0.190.0000.00717.38
8.0.180.0040.00417.35
8.0.170.0040.00417.28
8.0.160.0040.00417.32
8.0.150.0000.00817.30
8.0.140.0070.00017.19
8.0.130.0000.00613.64
8.0.120.0020.00517.27
8.0.110.0000.00817.18
8.0.100.0040.00417.12
8.0.90.0000.00917.13
8.0.80.0060.00917.29
8.0.70.0050.00217.41
8.0.60.0040.00417.39
8.0.50.0040.00417.36
8.0.30.0160.01017.28
8.0.20.0110.00817.53
8.0.10.0040.00417.31
8.0.00.0170.01117.20
7.4.330.0020.00215.55
7.4.320.0060.00016.95
7.4.300.0000.00616.97
7.4.290.0020.00516.89
7.4.280.0060.00316.96
7.4.270.0040.00416.88
7.4.260.0050.00013.51
7.4.250.0000.00716.84
7.4.240.0030.00516.81
7.4.230.0040.00416.89
7.4.220.0030.00516.83
7.4.210.0110.00716.95
7.4.200.0050.00216.80
7.4.130.0110.00716.83
7.4.120.0130.01217.02
7.4.110.0000.02216.87
7.4.100.0090.00916.85
7.4.90.0060.01416.71
7.4.80.0060.01319.39
7.4.70.0080.00816.91
7.4.60.0040.01216.79
7.4.50.0030.01416.75
7.4.40.0060.01016.54
7.4.30.0070.01016.58
7.4.20.0110.00616.82
7.4.10.0120.00416.75
7.4.00.0050.01116.75
7.3.330.0040.00416.65
7.3.320.0050.00013.29
7.3.310.0020.00516.54
7.3.300.0030.00316.62
7.3.290.0100.00716.62
7.3.260.0130.01016.55
7.3.240.0100.00816.69
7.3.230.0070.01016.66
7.3.210.0160.00316.70
7.3.200.0130.00316.73
7.3.190.0110.00716.83
7.3.180.0030.01416.58
7.3.170.0100.00616.69
7.3.160.0030.01416.54
7.3.150.0070.01016.50
7.3.140.0000.01516.52
7.3.130.0000.01516.55
7.3.120.0060.01016.71
7.3.110.0070.01016.71
7.3.100.0090.01216.61
7.3.90.0070.01416.46
7.3.80.0060.01216.71
7.3.70.0030.01216.42
7.3.60.0030.01716.66
7.3.50.0080.00816.61
7.3.40.0040.01216.38
7.3.30.0110.00616.58
7.3.20.0060.01216.64
7.3.10.0130.00416.53
7.3.00.0140.00316.61
7.2.330.0060.01317.00
7.2.320.0040.01916.77
7.2.310.0080.00816.69
7.2.300.0080.00916.70
7.2.290.0090.00616.68
7.2.280.0090.00916.77
7.2.270.0070.01016.95
7.2.260.0060.00916.61
7.2.250.0140.00416.93
7.2.240.0130.00617.07
7.2.230.0160.00616.98
7.2.220.0080.01216.89
7.2.210.0070.01116.89
7.2.200.0160.00616.79
7.2.190.0070.01016.75
7.2.180.0070.01016.80
7.2.170.0070.01016.89
7.2.160.0080.00816.82
7.2.150.0080.01116.86
7.2.140.0100.00716.91
7.2.130.0030.01316.78
7.2.120.0090.00616.81
7.2.110.0030.01317.03
7.2.100.0100.00716.82
7.2.90.0110.00816.95
7.2.80.0130.00716.82
7.2.70.0070.01316.90
7.2.60.0060.01316.90
7.2.50.0060.01216.98
7.2.40.0070.01016.72
7.2.30.0090.00816.84
7.2.20.0040.01216.55
7.2.10.0040.01216.92
7.2.00.0040.01316.78

preferences:
59.47 ms | 401 KiB | 5 Q