3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = <<<HTML <div> <img src="/relative/url/img.jpg" /> <form action="/"></form> <form action="/contact-us/"></form> <a href='/relative/url/'>Note the Single Quote</a> <img src="//example.com/protocol-relative-img.jpg" /> </div> HTML; $domain = '//example.com'; $tagsAndAttributes = [ 'img' => 'src', 'form' => 'action', 'a' => 'href' ]; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); foreach ($tagsAndAttributes as $tag => $attr) { foreach ($xpath->query("//{$tag}[not(starts-with(@{$attr}, '//'))]") as $node) { $node->setAttribute($attr, $domain . $node->getAttribute($attr)); } } echo $dom->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.5.90.0110.00718.02
8.5.80.0100.00817.85
8.5.70.0120.00617.92
8.5.60.0100.00618.16
8.5.50.0120.00617.76
8.5.40.0110.01118.78
8.5.30.0100.00818.19
8.5.20.0110.00719.35
8.5.10.0170.00618.09
8.5.00.0140.01020.33
8.4.240.0120.00520.82
8.4.230.0160.00720.91
8.4.220.0140.00820.89
8.4.210.0130.01120.78
8.4.200.0120.00721.75
8.4.190.0070.00421.80
8.4.180.0110.00620.87
8.4.170.0100.00922.04
8.4.160.0120.00523.02
8.4.150.0090.00518.56
8.4.140.0090.00718.73
8.4.130.0060.00319.02
8.4.120.0100.00720.48
8.4.110.0110.00921.40
8.4.100.0100.00919.04
8.4.90.0110.00819.47
8.4.80.0090.00718.96
8.4.70.0090.00719.03
8.4.60.0120.00419.52
8.4.50.0140.00819.01
8.4.40.0110.00519.79
8.4.30.0060.00920.38
8.4.20.0140.00818.93
8.4.10.0070.00819.84
8.3.330.0120.00919.68
8.3.320.0130.00719.64
8.3.310.0150.00819.65
8.3.300.0150.00919.67
8.3.290.0130.00920.76
8.3.280.0120.01119.54
8.3.270.0180.00717.79
8.3.260.0130.00917.91
8.3.250.0130.00519.01
8.3.240.0120.00617.94
8.3.230.0090.00417.88
8.3.220.0130.00318.10
8.3.210.0110.00717.79
8.3.200.0110.00417.81
8.3.190.0140.00618.30
8.3.180.0090.00718.73
8.3.170.0150.00519.00
8.3.160.0080.00818.02
8.3.150.0100.01219.98
8.3.140.0090.00917.90
8.3.130.0090.00318.81
8.3.120.0090.01119.17
8.3.110.0080.00619.87
8.3.100.0080.00621.31
8.3.90.0100.00922.77
8.3.80.0070.00717.99
8.3.70.0150.00517.80
8.3.60.0130.00918.86
8.3.50.0130.00622.00
8.3.40.0120.00819.65
8.3.30.0140.00319.58
8.3.20.0070.00720.51
8.3.10.0060.00821.20
8.3.00.0050.00721.05
8.2.330.0140.00820.00
8.2.320.0120.00719.24
8.2.310.0130.00719.27
8.2.300.0210.01118.29
8.2.290.0190.00518.96
8.2.280.0180.00817.82
8.2.270.0200.00717.29
8.2.260.0220.00518.69
8.2.250.0220.00717.85
8.2.240.0170.00817.25
8.2.230.0120.00519.64
8.2.220.0140.00927.17
8.2.210.0150.00821.67
8.2.200.0180.00516.86
8.2.190.0200.00617.86
8.2.180.0170.01217.90
8.2.170.0190.00920.63
8.2.160.0170.00919.90
8.2.150.0160.00521.12
8.2.140.0100.00721.31
8.2.130.0170.00322.23
8.2.120.0160.00619.78
8.2.110.0140.00721.12
8.2.100.0150.00719.63
8.2.90.0180.00519.49
8.2.80.0160.00919.70
8.2.70.0160.00819.43
8.2.60.0100.00520.03
8.2.50.0150.00719.56
8.2.40.0140.00819.91
8.2.30.0120.00919.82
8.2.20.0130.00719.05
8.2.10.0110.00919.92
8.2.00.0110.00620.06
8.1.340.0190.01019.03
8.1.330.0210.00819.50
8.1.320.0230.00516.40
8.1.310.0210.00617.61
8.1.300.0180.00917.66
8.1.290.0180.00517.68
8.1.280.0210.00521.04
8.1.270.0160.00519.56
8.1.260.0090.00722.21
8.1.250.0110.00723.08
8.1.240.0130.00420.80
8.1.230.0090.01120.09
8.1.220.0080.00819.45
8.1.210.0090.00920.22
8.1.200.0060.00819.21
8.1.190.0120.00519.16
8.1.180.0080.00819.54
8.1.170.0100.00819.59
8.1.160.0100.00619.83
8.1.150.0120.00719.64
8.1.140.0110.00920.13
8.1.130.0100.00719.31
8.1.120.0120.00819.27
8.1.110.0090.00619.27
8.1.100.0080.00819.20
8.1.90.0100.00519.23
8.1.80.0130.00419.23
8.1.70.0100.00718.82
8.1.60.0090.00518.89
8.1.50.0130.00618.83
8.1.40.0110.00718.91
8.1.30.0100.00718.93
8.1.20.0120.00518.89
8.1.10.0080.00718.85
8.1.00.0070.00619.15
8.0.300.0060.00419.49
8.0.290.0060.00519.11
8.0.280.0050.00519.47
8.0.270.0050.00619.13
8.0.260.0050.00719.57
8.0.250.0060.00419.17
8.0.240.0060.00619.25
8.0.230.0080.00519.38
8.0.220.0080.00519.09
8.0.210.0100.00618.62
8.0.200.0110.00518.29
8.0.190.0100.00518.23
8.0.180.0110.00418.23
8.0.170.0100.00718.21
8.0.160.0110.00618.16
8.0.150.0090.00318.20
8.0.140.0100.00518.40
8.0.130.0100.00517.59
8.0.120.0090.00418.48
8.0.110.0070.00518.45
8.0.100.0060.00618.47
8.0.90.0080.00618.39
8.0.80.0090.00818.33
8.0.70.0090.00418.56
8.0.60.0100.00418.49
8.0.50.0100.00618.50
8.0.30.0100.00818.52
8.0.20.0080.00818.52
8.0.10.0110.00618.61
8.0.00.0110.00519.23
7.4.330.0090.00516.46
7.4.320.0120.00518.67
7.4.300.0110.00518.03
7.4.290.0100.00718.08
7.4.280.0110.00618.00
7.4.270.0070.00617.96
7.4.260.0090.00717.46
7.4.250.0090.00418.14
7.4.240.0080.00617.94
7.4.230.0090.00618.14
7.4.220.0070.00617.96
7.4.210.0080.00717.80
7.4.200.0080.00618.06
7.4.190.0120.00718.74
7.4.180.0080.00918.74
7.4.160.0110.00518.59
7.4.150.0110.00518.63
7.4.140.0100.00718.54
7.4.130.0090.00617.79
7.4.120.0100.00717.92
7.4.110.0120.00817.63
7.4.100.0120.00717.76
7.4.90.0130.00517.74
7.4.80.0110.00518.19
7.4.70.0140.00317.74
7.4.60.0120.00717.74
7.4.50.0130.00717.55
7.4.40.0130.00617.65
7.4.30.0140.00818.14
7.4.20.0140.00617.69
7.4.10.0090.00817.64
7.4.00.0110.00617.94
7.3.330.0060.00717.95
7.3.320.0160.00316.82
7.3.310.0170.00517.19
7.3.300.0180.00317.41
7.3.290.0150.00717.04
7.3.280.0200.00617.74
7.3.270.0200.00617.55
7.3.260.0180.00417.36
7.3.250.0150.00817.68
7.3.240.0140.00817.73
7.3.230.0160.00517.21
7.3.220.0190.00717.48
7.3.210.0180.00617.27
7.3.200.0170.00717.29
7.3.190.0170.00317.32
7.3.180.0140.00517.26
7.3.170.0150.00617.31
7.3.160.0150.00517.27
7.3.150.0130.00417.52
7.3.140.0190.00417.30
7.3.130.0180.00517.21
7.3.120.0170.00617.22
7.3.110.0160.00517.23
7.3.100.0140.00817.25
7.3.90.0180.00517.48
7.3.80.0170.00717.32
7.3.70.0180.00517.30
7.3.60.0160.00617.28
7.3.50.0150.00717.34
7.3.40.0120.00817.24
7.3.30.0160.00617.45
7.3.20.0140.00618.55
7.3.10.0170.00618.51
7.3.00.0100.00518.48
7.2.340.0120.00318.59
7.2.330.0180.00517.10
7.2.320.0200.00616.90
7.2.310.0180.00517.11
7.2.300.0170.00717.05
7.2.290.0160.00717.08
7.2.280.0200.00617.23
7.2.270.0170.00517.06
7.2.260.0190.00417.09
7.2.250.0170.00717.07
7.2.240.0150.01117.12
7.2.230.0150.00617.14
7.2.220.0200.00617.08
7.2.210.0180.00817.08
7.2.200.0190.00617.16
7.2.190.0160.00617.27
7.2.180.0190.00517.09
7.2.170.0150.01017.15
7.2.160.0170.00717.20
7.2.150.0180.00518.75
7.2.140.0170.00618.68
7.2.130.0170.00718.83
7.2.120.0200.00618.85
7.2.110.0210.00618.65
7.2.100.0170.00718.75
7.2.90.0150.01018.61
7.2.80.0210.00518.77
7.2.70.0190.00618.72
7.2.60.0160.00918.58
7.2.50.0180.00818.78
7.2.40.0160.00818.83
7.2.30.0140.00818.79
7.2.20.0140.01018.69
7.2.10.0180.00818.81
7.2.00.0090.01118.77

preferences:
76.91 ms | 1724 KiB | 5 Q