3v4l.org

run code in 300+ PHP versions simultaneously
<?php function modify_href( $href ) { return $href . '/modified'; } $string = '<div> <a href="http://somelink" class="possible-class">text</a> <a href="http://anotherlink">other text</a> </div>'; $doc = new DomDocument(); $fragment = $doc->createDocumentFragment(); $fragment->appendXML($string); $doc->appendChild($fragment); $xpath = new DOMXPath($doc); $elements = $xpath->query("//div/a"); foreach ($elements as $element) { $element->setAttribute("href", modify_href($element->getAttribute("href"))); } 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.5.00.0160.00520.34
8.4.150.0010.00114.05
8.4.140.0120.00818.14
8.4.130.0100.01018.09
8.4.120.0110.00926.29
8.4.110.0130.00719.09
8.4.100.0140.00718.22
8.4.90.0120.00819.22
8.4.80.0110.00619.97
8.4.70.0130.00718.16
8.4.60.0050.00518.86
8.4.50.0110.00718.40
8.4.40.0040.01118.11
8.4.30.0140.00717.79
8.4.20.0100.01020.06
8.4.10.0040.00420.73
8.3.280.0020.00014.05
8.3.270.0120.00917.20
8.3.260.0130.00816.88
8.3.250.0130.00619.11
8.3.240.0060.00317.05
8.3.230.0110.00817.02
8.3.220.0100.00917.61
8.3.210.0100.00816.91
8.3.200.0060.00316.99
8.3.190.0070.00817.43
8.3.180.0100.00816.79
8.3.170.0090.00917.08
8.3.160.0140.00417.12
8.3.150.0150.00317.68
8.3.140.0040.00417.71
8.3.130.0090.00018.77
8.3.120.0030.00619.41
8.3.110.0080.00418.62
8.3.100.0100.01018.73
8.3.90.0080.00018.64
8.3.80.0090.00017.97
8.3.70.0140.00717.00
8.3.60.0090.00918.83
8.3.50.0040.00918.64
8.3.40.0120.00319.03
8.3.30.0180.00018.91
8.3.20.0080.00019.35
8.3.10.0080.00022.19
8.3.00.0050.00318.27
8.2.290.0080.01121.00
8.2.280.0040.00618.70
8.2.270.0100.01017.22
8.2.260.0130.00621.11
8.2.250.0000.00819.07
8.2.240.0090.00021.13
8.2.230.0030.00520.94
8.2.220.0060.00324.06
8.2.210.0050.00326.77
8.2.200.0030.00717.00
8.2.190.0120.00317.13
8.2.180.0160.00616.75
8.2.170.0040.01222.96
8.2.160.0110.00719.58
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0000.00820.33
8.2.120.0040.00426.35
8.2.110.0070.00322.50
8.2.100.0090.00318.16
8.2.90.0080.00022.83
8.2.80.0050.00318.13
8.2.70.0030.00518.30
8.2.60.0000.01018.42
8.2.50.0000.00818.10
8.2.40.0040.00419.55
8.2.30.0080.00020.00
8.2.20.0020.00518.45
8.2.10.0040.00418.55
8.2.00.0040.00420.01
8.1.330.0150.00322.61
8.1.320.0100.01016.82
8.1.310.0060.00317.02
8.1.300.0070.01018.99
8.1.290.0030.00718.88
8.1.280.0210.00025.92
8.1.270.0070.00024.19
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00722.82
8.1.230.0070.00421.47
8.1.220.0050.00318.26
8.1.210.0050.00319.47
8.1.200.0030.00717.73
8.1.190.0000.00817.73
8.1.180.0030.00618.10
8.1.170.0060.00319.07
8.1.160.0040.00419.37
8.1.150.0000.00719.35
8.1.140.0030.00518.31
8.1.130.0000.00719.48
8.1.120.0040.00417.83
8.1.110.0060.00317.81
8.1.100.0040.00417.89
8.1.90.0000.00717.91
8.1.80.0000.00717.93
8.1.70.0000.00817.77
8.1.60.0080.00018.05
8.1.50.0030.00518.02
8.1.40.0040.00418.03
8.1.30.0050.00518.18
8.1.20.0000.00717.98
8.1.10.0000.00918.06
8.1.00.0030.00618.01
8.0.300.0070.00020.28
8.0.290.0030.00617.25
8.0.280.0000.00718.91
8.0.270.0000.00817.66
8.0.260.0040.00417.66
8.0.250.0070.00017.46
8.0.240.0030.00617.40
8.0.230.0040.00417.37
8.0.220.0050.00317.16
8.0.210.0000.00717.21
8.0.200.0040.00417.29
8.0.190.0000.00717.41
8.0.180.0040.00417.23
8.0.170.0110.00017.42
8.0.160.0080.00017.36
8.0.150.0050.00317.30
8.0.140.0070.00017.36
8.0.130.0030.00313.80
8.0.120.0080.00017.29
8.0.110.0050.00217.40
8.0.100.0090.00017.36
8.0.90.0040.00417.35
8.0.80.0040.01117.29
8.0.70.0000.00717.19
8.0.60.0050.00217.28
8.0.50.0000.00817.24
8.0.30.0090.01017.53
8.0.20.0070.01617.50
8.0.10.0030.00517.49
8.0.00.0070.01017.25
7.4.330.0060.00015.55
7.4.320.0030.00316.95
7.4.300.0000.00716.95
7.4.290.0000.00717.02
7.4.280.0030.00516.84
7.4.270.0040.00317.04
7.4.260.0000.00716.88
7.4.250.0000.00717.02
7.4.240.0000.00717.01
7.4.230.0050.00316.94
7.4.220.0030.00517.00
7.4.210.0030.01017.07
7.4.200.0060.00016.86
7.4.160.0070.01016.91
7.4.140.0110.00817.86
7.4.130.0110.00717.02
7.4.120.0130.00916.92
7.4.110.0150.00916.79
7.4.100.0110.00717.08
7.4.90.0070.01016.89
7.4.80.0120.00619.39
7.4.70.0040.01216.95
7.4.60.0090.00616.96
7.4.50.0100.00417.03
7.4.40.0060.01316.75
7.4.10.0100.00715.14
7.4.00.0060.01115.25
7.3.330.0000.00613.46
7.3.320.0000.00713.71
7.3.310.0050.00216.75
7.3.300.0000.00716.75
7.3.290.0030.00316.76
7.3.280.0030.01216.76
7.3.260.0110.00616.85
7.3.240.0070.01116.90
7.3.230.0130.01016.76
7.3.210.0090.01616.94
7.3.200.0120.01117.09
7.3.190.0090.01417.00
7.3.180.0090.00816.97
7.3.170.0090.00916.73
7.3.160.0040.01216.98
7.3.130.0070.01315.11
7.3.120.0110.00714.87
7.3.110.0070.01015.12
7.3.100.0040.01115.36
7.3.90.0100.00014.94
7.3.80.0000.01614.92
7.3.70.0090.00915.02
7.3.60.0090.00614.96
7.3.50.0030.00814.95
7.3.40.0110.00415.05
7.3.30.0090.00614.98
7.3.20.0040.00816.83
7.3.10.0090.00616.76
7.3.00.0060.01016.95
7.2.330.0120.00917.18
7.2.320.0070.01117.06
7.2.310.0070.01717.18
7.2.300.0060.01617.19
7.2.290.0120.00617.16
7.2.260.0120.00315.39
7.2.250.0000.01815.05
7.2.240.0060.00915.39
7.2.230.0070.00715.37
7.2.220.0070.01015.01
7.2.210.0000.01515.30
7.2.200.0100.00315.24
7.2.190.0150.00015.25
7.2.180.0060.00915.19
7.2.170.0070.01015.18
7.2.160.0090.00615.17
7.2.150.0040.01117.36
7.2.140.0110.00717.28
7.2.130.0080.00817.21
7.2.120.0000.01317.01
7.2.110.0100.00317.16
7.2.100.0040.00717.32
7.2.90.0070.01017.02
7.2.80.0070.00617.10
7.2.70.0030.00916.82
7.2.60.0070.00717.11
7.2.50.0030.01016.98
7.2.40.5370.01117.45
7.2.30.3370.01017.64
7.2.20.2960.01117.75
7.2.10.0100.01117.38
7.2.00.0350.01217.66
7.1.330.0070.00715.71
7.1.320.0000.01116.01
7.1.310.0060.00915.82
7.1.300.0030.01015.95
7.1.290.0080.00615.91
7.1.280.0040.01416.15
7.1.270.0000.01616.00
7.1.260.0100.00615.88
7.1.250.0140.00315.86
7.1.240.0030.00916.08
7.1.230.0060.00616.25
7.1.220.0090.00616.16
7.1.210.0110.00415.80
7.1.200.0020.01315.91
7.1.190.0070.00716.10
7.1.180.0060.00815.86
7.1.170.0070.00716.02
7.1.160.3990.00916.34
7.1.150.3330.00916.45
7.1.140.0070.00716.20
7.1.130.0080.01216.14
7.1.120.0310.00816.39
7.1.110.0260.00816.25
7.1.100.0070.00916.21
7.1.90.0120.00616.08
7.1.80.0070.01316.27
7.1.70.0140.01015.77
7.1.60.0770.01424.81
7.1.50.0140.01124.65
7.1.40.0800.00924.27
7.1.30.0540.00624.31
7.1.20.0200.00824.34
7.1.10.2180.01015.45
7.1.00.3880.00915.52
7.0.330.0040.00715.46
7.0.320.0120.00615.58
7.0.310.0090.00415.50
7.0.300.0120.00015.55
7.0.290.0100.00315.68
7.0.280.0110.00415.72
7.0.270.0090.00015.62
7.0.260.0030.01415.60
7.0.250.0030.00615.65
7.0.240.0080.00415.41
7.0.230.0100.00015.59
7.0.220.0080.00615.71
7.0.210.0030.01515.59
7.0.200.0000.01415.55
7.0.190.0060.00615.48
7.0.180.0030.01315.43
7.0.170.0030.01015.65
7.0.160.0060.00615.48
7.0.150.0080.00815.61
7.0.140.0030.00915.71
7.0.130.0100.00315.54
7.0.120.0090.00615.52
7.0.110.0070.00715.69
7.0.100.0120.00615.50
7.0.90.0060.01315.82
7.0.80.0070.00715.83
7.0.70.0000.01415.48
7.0.60.0000.01115.69
7.0.50.0060.00615.70
7.0.40.0040.01213.66
7.0.30.0070.00713.40
7.0.20.0040.00413.64
7.0.10.0090.00613.55
7.0.00.0040.00813.51
5.6.400.0090.00414.64
5.6.390.0060.00314.43
5.6.380.0040.01614.59
5.6.370.0070.00714.24
5.6.360.0060.00614.51
5.6.350.0090.00614.19
5.6.340.0030.01014.66
5.6.330.0030.01014.62
5.6.320.0070.00714.39
5.6.310.0070.00714.51
5.6.300.0100.00714.55
5.6.290.0030.01314.56
5.6.280.0070.00714.80
5.6.270.0000.01314.37
5.6.260.0000.01214.30
5.6.250.0030.01214.42
5.6.240.0050.00614.52
5.6.230.0090.00914.59
5.6.220.0070.00714.46
5.6.210.0030.00714.82
5.6.200.0030.01014.39
5.6.190.0030.01014.63
5.6.180.0060.01014.46
5.6.170.0030.01214.22
5.6.160.0060.01014.30
5.6.150.0060.00614.55
5.6.140.0030.01014.52
5.6.130.0000.00914.62
5.6.120.0040.00814.49
5.6.110.0060.00614.46
5.6.100.0060.00914.55
5.6.90.0120.00314.56
5.6.80.0030.00914.41
5.6.70.0060.00914.66
5.6.60.0040.01214.33
5.6.50.0000.00914.52
5.6.40.0060.00314.39
5.6.30.0060.00314.42
5.6.20.0030.01014.39
5.6.10.0070.00714.36
5.6.00.0120.00014.52

preferences:
33.78 ms | 403 KiB | 5 Q