3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <span class="place ville">Ville : <span>City name 1</span></span> <span class="place ville">Ville : <span><a href="https://example.com">City name 2</a></span></span> HTML; $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXpath($dom); $nodeList = $xpath->query("//span[contains(@class, 'place') and contains(@class, 'ville')]/span"); foreach ($nodeList as $n) { echo $n->textContent . PHP_EOL; }

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.00720.25
8.4.150.0010.00214.05
8.4.140.0120.00917.90
8.4.130.0080.00418.40
8.4.120.0100.00921.27
8.4.110.0140.00522.80
8.4.100.0130.00818.13
8.4.90.0150.00621.14
8.4.80.0060.00318.12
8.4.70.0060.00217.95
8.4.60.0100.01119.19
8.4.50.0120.00820.73
8.4.40.0110.00019.70
8.4.30.0150.00320.61
8.4.20.0200.00024.55
8.4.10.0170.00319.89
8.3.280.0110.00818.92
8.3.270.0110.00916.69
8.3.260.0110.00916.63
8.3.250.0130.00619.13
8.3.240.0030.00617.03
8.3.230.0130.00616.80
8.3.220.0060.00219.54
8.3.210.0070.00718.60
8.3.200.0030.00616.91
8.3.190.0090.01017.45
8.3.180.0110.00816.78
8.3.170.0060.01217.63
8.3.160.0060.00916.91
8.3.150.0160.00318.80
8.3.140.0040.00417.46
8.3.130.0060.00318.72
8.3.120.0080.00019.52
8.3.110.0060.00320.94
8.3.100.0090.00024.06
8.3.90.0000.00826.77
8.3.80.0060.00317.13
8.3.70.0090.00916.75
8.3.60.0050.01018.79
8.3.50.0190.00417.74
8.3.40.0110.00419.04
8.3.30.0000.01519.08
8.3.20.0080.00022.15
8.3.10.0040.00422.04
8.3.00.0060.00323.86
8.2.290.0120.00720.69
8.2.280.0060.01218.85
8.2.270.0100.01017.48
8.2.260.0110.00416.92
8.2.250.0000.00817.07
8.2.240.0100.01017.76
8.2.230.0060.00322.58
8.2.220.0040.01237.54
8.2.210.0000.00726.77
8.2.200.0060.00317.25
8.2.190.0090.00916.88
8.2.180.0110.00418.79
8.2.170.0070.01122.96
8.2.160.0100.00320.74
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0000.00826.16
8.2.110.0060.00321.31
8.2.100.0090.00317.97
8.2.90.0060.00617.88
8.2.80.0040.00419.03
8.2.70.0140.00017.63
8.2.60.0000.00818.30
8.2.50.0000.00818.07
8.2.40.0080.00020.32
8.2.30.0030.00518.46
8.2.20.0030.00618.39
8.2.10.0000.00719.54
8.2.00.0060.00319.73
8.1.330.0130.00622.14
8.1.320.0110.00916.35
8.1.310.0070.01118.75
8.1.300.0030.00518.15
8.1.290.0030.00818.88
8.1.280.0040.01125.92
8.1.270.0040.00422.46
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0060.00321.67
8.1.230.0080.00318.14
8.1.220.0040.00418.16
8.1.210.0030.00618.77
8.1.200.0130.00017.48
8.1.190.0040.00417.47
8.1.180.0030.00518.10
8.1.170.0000.00818.94
8.1.160.0000.00819.21
8.1.150.0050.00319.23
8.1.140.0040.00419.26
8.1.130.0000.00820.50
8.1.120.0040.00417.73
8.1.110.0000.00817.85
8.1.100.0000.00817.68
8.1.90.0000.00817.84
8.1.80.0030.00617.55
8.1.70.0050.00317.69
8.1.60.0000.00817.87
8.1.50.0000.00817.88
8.1.40.0030.00617.86
8.1.30.0040.00418.02
8.1.20.0040.00418.01
8.1.10.0080.00017.88
8.1.00.0050.00217.91
8.0.300.0030.00619.09
8.0.290.0030.00617.25
8.0.280.0030.00618.73
8.0.270.0030.00317.48
8.0.260.0070.00018.66
8.0.250.0030.00317.22
8.0.240.0030.00317.37
8.0.230.0000.00717.29
8.0.220.0050.00317.24
8.0.210.0030.00317.14
8.0.200.0000.00717.23
8.0.190.0030.00617.34
8.0.180.0040.00417.36
8.0.170.0050.00317.36
8.0.160.0110.00017.23
8.0.150.0020.00517.12
8.0.140.0040.00417.15
8.0.130.0090.00415.45
8.0.120.0070.00717.27
8.0.110.0050.00817.23
8.0.100.0110.00317.35
8.0.90.0110.00317.29
8.0.80.0100.00717.30
8.0.70.0120.00217.19
8.0.60.0100.00417.27
8.0.50.0090.00517.06
8.0.30.0060.01117.41
8.0.20.0170.00417.50
8.0.10.0130.00817.30
8.0.00.0110.00617.19
7.4.330.0000.00515.55
7.4.320.0060.00016.68
7.4.300.0050.00216.91
7.4.290.0000.00816.79
7.4.280.0000.00816.75
7.4.270.0000.00716.82
7.4.260.0110.00316.80
7.4.250.0100.00416.76
7.4.240.0080.00416.90
7.4.230.0100.00516.77
7.4.220.0080.00416.78
7.4.210.0110.00716.92
7.4.200.0100.00316.92
7.4.190.0090.00916.81
7.4.180.0150.00316.89
7.4.160.0110.00816.92
7.4.150.0160.00516.70
7.4.140.0130.00817.13
7.4.130.0160.00416.75
7.4.120.0130.00816.89
7.4.110.0120.00716.73
7.4.100.0160.00416.83
7.4.90.0090.01216.78
7.4.80.0110.01017.64
7.4.70.0130.01216.86
7.4.60.0120.00816.84
7.4.50.0150.00316.82
7.4.40.0160.00416.81
7.4.30.0130.00716.78
7.4.20.0160.00416.79
7.4.10.0190.00216.86
7.4.00.0100.01116.12
7.3.330.0080.00415.12
7.3.320.0060.00615.14
7.3.310.0110.00316.42
7.3.300.0080.00516.74
7.3.290.0060.00716.63
7.3.280.0100.00916.67
7.3.270.0140.00816.78
7.3.260.0120.00916.71
7.3.250.0120.00716.67
7.3.240.0160.00516.74
7.3.230.0150.00616.55
7.3.220.0100.01116.49
7.3.210.0070.01016.73
7.3.200.0130.00516.70
7.3.190.0130.00916.70
7.3.180.0120.00616.65
7.3.170.0110.00716.64
7.3.160.0090.01016.73
7.3.150.0190.00316.78
7.3.140.0090.00916.67
7.3.130.0150.00516.66
7.3.120.0100.00816.16
7.3.110.0120.00716.15
7.3.100.0110.00716.13
7.3.90.0140.00516.14
7.3.80.0070.01116.17
7.3.70.0130.00416.02
7.3.60.0100.00615.76
7.3.50.0100.00715.91
7.3.40.0100.00615.81
7.3.30.0100.00715.83
7.3.20.0100.00516.78
7.3.10.0110.00816.69
7.3.00.0130.00816.62
7.2.340.0140.01016.63
7.2.330.0150.00716.66
7.2.320.0150.00916.64
7.2.310.0130.00916.88
7.2.300.0130.01116.79
7.2.290.0120.01016.86
7.2.280.0160.00616.72
7.2.270.0180.00516.92
7.2.260.0160.01016.77
7.2.250.0170.00816.79
7.2.240.0130.00816.13
7.2.230.0130.00916.31
7.2.220.0100.01116.15
7.2.210.0120.00916.20
7.2.200.0150.01116.32
7.2.190.0100.00715.96
7.2.180.0120.00515.96
7.2.170.0120.00615.99
7.2.160.0110.00916.10
7.2.150.0120.00717.06
7.2.140.0090.00816.99
7.2.130.0110.00917.04
7.2.120.0110.01017.01
7.2.110.0130.00517.00
7.2.100.0130.00916.94
7.2.90.0120.00816.90
7.2.80.0120.00716.94
7.2.70.0170.00616.92
7.2.60.0140.00616.93
7.2.50.0200.01116.88
7.2.40.0200.01117.04
7.2.30.0150.00917.05
7.2.20.0140.01216.99
7.2.10.0230.01117.05
7.2.00.0150.00917.12
7.1.330.0120.00716.54
7.1.320.0100.00816.71
7.1.310.0090.01016.43
7.1.300.0100.00815.83
7.1.290.0090.00815.92
7.1.280.0120.00415.86
7.1.270.0110.00715.91
7.1.260.0110.00715.89
7.1.250.0110.00815.80
7.1.240.0130.01016.54
7.1.230.0180.00816.65
7.1.220.0210.00416.76
7.1.210.0250.00416.65
7.1.200.0140.00916.63
7.1.190.0110.01116.70
7.1.180.0400.01216.52
7.1.170.0330.00716.70
7.1.160.0120.01316.57
7.1.150.0210.00516.64
7.1.140.0260.00916.79
7.1.130.0170.00716.76
7.1.120.0200.00616.82
7.1.110.0210.00416.81
7.1.100.0180.00716.83
7.1.90.0150.00716.71
7.1.80.0260.00416.83
7.1.70.0170.00816.64
7.1.60.0190.00616.70
7.1.50.0210.00616.82
7.1.40.0340.00716.72
7.1.30.0200.00416.73
7.1.20.0150.01016.64
7.1.10.0180.00916.77
7.1.00.0200.00716.75
7.0.330.0110.00916.36
7.0.320.0140.00816.36
7.0.310.0240.00516.40
7.0.300.0270.01216.43
7.0.290.0140.00616.33
7.0.280.0190.00516.42
7.0.270.0180.01016.31
7.0.260.0190.00516.53
7.0.250.0240.00616.58
7.0.240.0130.01016.64
7.0.230.0170.00716.65
7.0.220.0210.00516.43
7.0.210.0200.00516.44
7.0.200.0160.00816.54
7.0.190.0150.00816.42
7.0.180.0160.01016.54
7.0.170.0180.00516.56
7.0.160.0160.00616.35
7.0.150.0190.00516.45
7.0.140.0140.00816.47
7.0.130.0210.00616.50
7.0.120.0170.01016.32
7.0.110.0180.00716.48
7.0.100.0250.00516.47
7.0.90.0140.00816.48
7.0.80.0170.00716.34
7.0.70.0190.00716.34
7.0.60.0160.00816.48
7.0.50.0170.00716.45
7.0.40.0150.00816.54
7.0.30.0160.00816.44
7.0.20.0160.00716.36
7.0.10.0150.00916.47
7.0.00.0230.00216.28
5.6.400.0110.00716.05
5.6.390.0220.00616.01
5.6.380.0200.00316.13
5.6.370.0130.01416.04
5.6.360.0150.00716.00
5.6.350.0210.01716.04
5.6.340.0170.00716.14
5.6.330.0190.00716.26
5.6.320.0160.01016.20
5.6.310.0170.00816.25
5.6.300.0170.00616.04
5.6.290.0130.01215.94
5.6.280.0210.00816.14
5.6.270.0220.00716.14
5.6.260.0160.00916.01
5.6.250.0120.01116.09
5.6.240.0170.00816.12
5.6.230.0160.01016.05
5.6.220.0150.00916.08
5.6.210.0170.00916.23
5.6.200.0160.01016.03
5.6.190.0300.00216.00
5.6.180.0160.00716.21
5.6.170.0190.00916.22
5.6.160.0230.00216.20
5.6.150.0180.00716.14
5.6.140.0180.00716.24
5.6.130.0240.00416.23
5.6.120.0170.01116.20
5.6.110.0200.00416.19
5.6.100.0150.01016.17
5.6.90.0150.01216.06
5.6.80.0120.01115.83
5.6.70.0130.01016.09
5.6.60.0180.00616.10
5.6.50.0150.00915.93
5.6.40.0200.00415.96
5.6.30.0160.00816.08
5.6.20.0180.00515.99
5.6.10.0150.00816.10
5.6.00.0140.01115.96
5.5.380.0200.00816.33
5.5.370.0160.00816.13
5.5.360.0190.00616.15
5.5.350.0230.00515.99
5.5.340.0250.00215.99
5.5.330.0190.00715.98
5.5.320.0200.00716.10
5.5.310.0140.01016.07
5.5.300.0250.01016.01
5.5.290.0210.00516.08
5.5.280.0140.01015.96
5.5.270.0110.01415.99
5.5.260.0180.00816.23
5.5.250.0180.00716.16
5.5.240.0180.00616.26
5.5.230.0180.00516.18
5.5.220.0130.01116.00
5.5.210.0130.00915.97
5.5.200.0160.00716.06
5.5.190.0130.01016.08
5.5.180.0150.00915.99
5.5.170.0190.00515.91
5.5.160.0190.00416.12
5.5.150.0140.01216.14
5.5.140.0150.00916.02
5.5.130.0200.01115.76
5.5.120.0120.01015.91
5.5.110.0150.00815.99
5.5.100.0150.00816.02
5.5.90.0140.00915.96
5.5.80.0170.00615.98
5.5.70.0150.00816.30
5.5.60.0150.00816.07
5.5.50.0210.00816.17
5.5.40.0130.01315.97
5.5.30.0170.00716.16
5.5.20.0380.01915.89
5.5.10.0230.01515.94
5.5.00.0180.00815.94
5.4.450.0170.00313.08
5.4.440.0160.00313.01
5.4.430.0120.00713.07
5.4.420.0150.00412.85
5.4.410.0140.00512.77
5.4.400.0180.00712.92
5.4.390.0150.00512.98
5.4.380.0170.00213.03
5.4.370.0170.00412.86
5.4.360.0130.00512.78
5.4.350.0140.00612.86
5.4.340.0160.00312.91
5.4.330.0170.00312.78
5.4.320.0160.00312.92
5.4.310.0140.00912.98
5.4.300.0140.00412.88
5.4.290.0170.00212.76
5.4.280.0090.00912.82
5.4.270.0100.00912.85
5.4.260.0150.00712.81
5.4.250.0140.00512.81
5.4.240.0120.00512.89
5.4.230.0140.00512.70
5.4.220.0160.00712.72
5.4.210.0120.00712.71
5.4.200.0130.00912.72
5.4.190.0210.00212.74
5.4.180.0270.01012.77
5.4.170.0150.01312.67
5.4.160.0200.00312.72
5.4.150.0200.00812.75
5.4.140.0110.00913.01
5.4.130.0110.01112.79
5.4.120.0260.00312.72
5.4.110.0150.00812.79
5.4.100.0110.00712.88
5.4.90.0310.00312.86
5.4.80.0130.00512.87
5.4.70.0070.00712.95
5.4.60.0100.01312.97
5.4.50.0140.00412.90
5.4.40.0110.00512.83
5.4.30.0140.00512.82
5.4.20.0100.00512.95
5.4.10.0150.00212.90
5.4.00.0180.00312.90
5.3.290.0190.00113.44
5.3.280.0240.01013.22
5.3.270.0240.01013.37
5.3.260.0140.00513.38
5.3.250.0180.00813.27
5.3.240.0150.00513.18
5.3.230.0120.00913.38
5.3.220.0160.00313.06
5.3.210.0110.00813.06
5.3.200.0080.01013.25
5.3.190.0130.00413.24
5.3.180.0120.00713.23
5.3.170.0160.00413.30
5.3.160.0120.00613.27
5.3.150.0140.00713.44
5.3.140.0130.00613.19
5.3.130.0130.00713.31
5.3.120.0180.00213.32
5.3.110.0140.00513.27
5.3.100.0120.01013.32
5.3.90.0140.00813.36
5.3.80.0140.00513.15
5.3.70.0130.00613.12
5.3.60.0110.00713.26
5.3.50.0200.01013.04
5.3.40.0180.00513.29
5.3.30.0120.00613.28
5.3.20.0110.00813.34
5.3.10.0120.00712.91
5.3.00.0120.00813.05
5.2.170.0140.00012.28
5.2.160.0100.00912.34
5.2.150.0070.00912.46
5.2.140.0150.00412.29
5.2.130.0080.00612.13
5.2.120.0100.00512.32
5.2.110.0110.00712.19
5.2.100.0130.00312.31
5.2.90.0120.00512.16
5.2.80.0100.00612.14
5.2.70.0110.00512.24
5.2.60.0140.00112.03
5.2.50.0110.00512.08
5.2.40.0110.00712.26
5.2.30.0090.00912.11
5.2.20.0080.00812.09
5.2.10.0130.00512.24
5.2.00.0060.00912.08
5.1.60.0080.00711.20
5.1.50.0120.00111.23
5.1.40.0090.00711.28
5.1.30.0100.00411.40
5.1.20.0110.00311.34
5.1.10.0080.00611.44
5.1.00.0120.00311.24
5.0.50.0050.00610.53
5.0.40.0080.00410.51
5.0.30.0100.00410.37
5.0.20.0090.00510.42
5.0.10.0080.00310.35
5.0.00.0080.00510.29
4.4.90.0090.0009.98
4.4.80.0080.0019.98
4.4.70.0040.0049.98
4.4.60.0050.0039.98
4.4.50.0070.0029.98
4.4.40.0080.0009.98
4.4.30.0050.0039.98
4.4.20.0050.0049.98
4.4.10.0040.0039.98
4.4.00.0040.0049.98
4.3.110.0070.0019.98
4.3.100.0040.0039.98
4.3.90.0070.0009.98
4.3.80.0060.0029.98
4.3.70.0050.0049.98
4.3.60.0050.0029.98
4.3.50.0050.0039.98
4.3.40.0030.0069.98
4.3.30.0070.0009.98
4.3.20.0080.0009.98
4.3.10.0030.0049.98
4.3.00.0010.0049.98

preferences:
170.69 ms | 403 KiB | 5 Q