3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "<html><meta http-equiv='content-type' content='text/html; charset=utf-8'><body><foo> <bar>bar</bar> bar</foo></body></html>"; $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $foo = $xpath->query('//foo')->item(0); $bars = $xpath->query('./bar', $foo); echo (($bars->length == 1) ? 'PASS' : 'FAIL') . "\n"; echo ((get_class($bars->item(0)) == 'DOMElement') ? 'PASS' : 'FAIL') . "\n";

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.0040.01117.13
8.3.50.0120.00822.09
8.3.40.0070.01119.24
8.3.30.0070.00719.42
8.3.20.0060.00320.71
8.3.10.0030.00524.03
8.3.00.0050.00319.50
8.2.180.0090.01218.92
8.2.170.0150.00322.96
8.2.160.0070.00720.89
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0120.00626.16
8.2.120.0030.00522.70
8.2.110.0060.00322.58
8.2.100.0120.00018.16
8.2.90.0030.00619.57
8.2.80.0030.00518.41
8.2.70.0040.00417.88
8.2.60.0040.00418.05
8.2.50.0030.00918.07
8.2.40.0060.00320.32
8.2.30.0000.00718.45
8.2.20.0040.00418.05
8.2.10.0050.00318.66
8.2.00.0040.00718.23
8.1.280.0100.01025.92
8.1.270.0080.00024.16
8.1.260.0090.00026.35
8.1.250.0030.00528.09
8.1.240.0030.00624.30
8.1.230.0090.00319.55
8.1.220.0000.00818.04
8.1.210.0080.00018.77
8.1.200.0000.00817.73
8.1.190.0060.00317.90
8.1.180.0030.00619.38
8.1.170.0050.00318.80
8.1.160.0040.00422.45
8.1.150.0060.00318.92
8.1.140.0040.00417.85
8.1.130.0000.00818.16
8.1.120.0040.00417.80
8.1.110.0030.00617.89
8.1.100.0000.00717.85
8.1.90.0040.00417.88
8.1.80.0000.00717.77
8.1.70.0000.00717.74
8.1.60.0040.00417.97
8.1.50.0040.00417.89
8.1.40.0050.00317.82
8.1.30.0050.00318.01
8.1.20.0000.00718.00
8.1.10.0040.00417.83
8.1.00.0040.00417.73
8.0.300.0070.00018.77
8.0.290.0040.00417.55
8.0.280.0000.00718.71
8.0.270.0030.00317.53
8.0.260.0060.00017.60
8.0.250.0030.00517.32
8.0.240.0080.00017.24
8.0.230.0040.00417.22
8.0.220.0040.00417.23
8.0.210.0050.00317.29
8.0.200.0000.00817.21
8.0.190.0040.00417.29
8.0.180.0040.00417.17
8.0.170.0040.00417.21
8.0.160.0030.00517.25
8.0.150.0040.00417.26
8.0.140.0050.00217.09
8.0.130.0000.00713.66
8.0.120.0000.00817.23
8.0.110.0040.00417.04
8.0.100.0050.00217.33
8.0.90.0040.00417.19
8.0.80.0030.01417.09
8.0.70.0000.00717.21
8.0.60.0050.00317.06
8.0.50.0040.00417.20
8.0.30.0110.01117.67
8.0.20.0060.01217.55
8.0.10.0040.00417.48
8.0.00.0090.01417.14
7.4.330.0020.00215.00
7.4.320.0030.00316.87
7.4.300.0040.00416.92
7.4.290.0000.00716.94
7.4.280.0030.00516.76
7.4.270.0040.00416.93
7.4.260.0080.00016.93
7.4.250.0080.00016.95
7.4.240.0040.00316.91
7.4.230.0030.00316.70
7.4.220.0060.01216.89
7.4.210.0080.00916.95
7.4.200.0000.00716.86
7.4.190.0030.00316.66
7.4.160.0070.01016.70
7.4.150.0090.01717.40
7.4.140.0100.01217.86
7.4.130.0070.01316.79
7.4.120.0110.00516.78
7.4.110.0070.01016.89
7.4.100.0140.00316.99
7.4.90.0060.01216.66
7.4.80.0150.00719.39
7.4.70.0090.01216.84
7.4.60.0070.01016.82
7.4.50.0000.00817.07
7.4.40.0070.01022.77
7.4.30.0060.01116.93
7.4.00.0030.01615.20
7.3.330.0030.00313.25
7.3.320.0000.00613.51
7.3.310.0040.00416.53
7.3.300.0030.00516.53
7.3.290.0070.00716.67
7.3.280.0090.00916.56
7.3.270.0030.01317.40
7.3.260.0070.01016.77
7.3.250.0060.01316.60
7.3.240.0070.01116.64
7.3.230.0100.00716.58
7.3.210.0140.00716.79
7.3.200.0060.01016.50
7.3.190.0180.00716.58
7.3.180.0070.01116.55
7.3.170.0070.01016.73
7.3.160.0060.00916.89
7.3.120.0110.00715.21
7.3.110.0140.00714.65
7.3.100.0100.00715.06
7.3.90.0060.00614.70
7.3.80.0090.00614.59
7.3.70.0070.00415.03
7.3.60.0070.01014.91
7.3.50.0050.00514.90
7.3.40.0040.00814.96
7.3.30.0090.00614.92
7.3.20.0090.00616.88
7.3.10.0060.00316.68
7.3.00.0030.01016.80
7.2.330.0030.01517.09
7.2.320.0090.00917.10
7.2.310.0030.01417.22
7.2.300.0000.01716.90
7.2.290.0090.00917.15
7.2.250.0120.00615.23
7.2.240.0090.00615.16
7.2.230.0060.00915.43
7.2.220.0040.00815.42
7.2.210.0000.01315.28
7.2.200.0110.00615.11
7.2.190.0000.01615.12
7.2.180.0070.00714.93
7.2.170.0090.00915.19
7.2.160.0070.00715.11
7.2.150.0090.00916.96
7.2.140.0030.01016.89
7.2.130.0090.00617.07
7.2.120.0060.00617.18
7.2.110.0060.01317.07
7.2.100.0090.00916.88
7.2.90.0060.01217.10
7.2.80.0090.00917.29
7.2.70.0030.01017.10
7.2.60.0030.01017.06
7.2.50.0000.01417.12
7.2.40.0040.01216.86
7.2.30.0100.00717.30
7.2.20.0000.01017.17
7.2.10.0120.00317.09
7.2.00.0040.00918.51
7.1.330.0060.00915.74
7.1.320.0000.00915.96
7.1.310.0030.00916.30
7.1.300.0080.00415.70
7.1.290.0040.00716.15
7.1.280.0040.01215.90
7.1.270.0090.00615.95
7.1.260.0050.00515.95
7.1.250.0030.01315.89
7.1.100.0030.01218.19
7.1.70.0040.00717.07
7.1.60.0070.00317.47
7.1.50.0110.00716.83
7.1.00.0030.07722.45
7.0.200.0100.00716.68
7.0.140.0070.06722.26
7.0.100.0070.04320.19
7.0.90.0530.07320.08
7.0.80.0400.08320.07
7.0.70.0430.07320.00
7.0.60.0500.08720.14
7.0.50.0500.06020.50
7.0.40.0070.06720.30
7.0.30.0130.07020.25
7.0.20.0100.03720.19
7.0.10.0070.04020.28
7.0.00.0000.04320.17
5.6.280.0030.07721.17
5.6.250.0070.08720.72
5.6.240.0070.09020.71
5.6.230.0130.08320.78
5.6.220.0170.07020.75
5.6.210.0030.08020.72
5.6.200.0100.07721.19
5.6.190.0170.07721.13
5.6.180.0030.06321.23
5.6.170.0070.04021.21
5.6.160.0000.03721.18
5.6.150.0030.03321.11
5.6.140.0070.04021.16
5.6.130.0000.03721.14
5.6.120.0000.03721.27
5.6.110.0000.04321.12
5.6.100.0070.07721.27
5.6.90.0100.03721.19
5.6.80.0030.04020.57
5.6.70.0070.05320.55
5.6.60.0000.04020.63
5.6.50.0070.03720.64
5.6.40.0030.03720.48
5.6.30.0030.03720.61
5.6.20.0030.04020.54
5.6.10.0030.04020.63
5.6.00.0000.04020.53
5.5.380.0030.08720.45
5.5.370.0100.07720.62
5.5.360.0070.08020.46
5.5.350.0070.08320.51
5.5.340.0130.07721.02
5.5.330.0100.06320.99
5.5.320.0170.06321.00
5.5.310.0030.04320.99
5.5.300.0030.04020.92
5.5.290.0070.04320.89
5.5.280.0030.04021.03
5.5.270.0030.04021.00
5.5.260.0030.04020.95
5.5.250.0000.05020.80
5.5.240.0000.04720.39
5.5.230.0070.04720.24
5.5.220.0030.04320.38
5.5.210.0030.04020.40
5.5.200.0070.03720.33
5.5.190.0030.04020.33
5.5.180.0100.05720.25
5.5.160.0000.04720.36
5.5.150.0000.04320.26
5.5.140.0070.03720.35
5.5.130.0100.03320.38
5.5.120.0100.06020.36
5.5.110.0070.08020.36
5.5.100.0130.07020.24
5.5.90.0100.07020.26
5.5.80.0100.06020.27
5.5.70.0000.04720.26
5.5.60.0130.06720.22
5.5.50.0030.08020.25
5.5.40.0100.03720.13
5.5.30.0100.04320.23
5.5.20.0070.04720.16
5.5.10.0030.08320.15
5.5.00.0000.08320.20
5.4.450.0070.03019.43
5.4.440.0030.06319.50
5.4.430.0030.04719.41
5.4.420.0070.05319.50
5.4.410.0000.04319.56
5.4.400.0070.04019.32
5.4.390.0030.03719.18
5.4.380.0000.04319.38
5.4.370.0030.03719.18
5.4.360.0100.05019.16
5.4.350.0030.03319.21
5.4.340.0070.03719.18
5.4.320.0030.05019.36
5.4.310.0070.04019.30
5.4.300.0070.07719.16
5.4.290.0030.04019.20
5.4.280.0030.05019.16
5.4.270.0100.05019.31
5.4.260.0100.07319.16
5.4.250.0030.04719.07
5.4.240.0030.07719.18
5.4.230.0100.08019.16
5.4.220.0100.07319.22
5.4.210.0130.07019.14
5.4.200.0030.06719.16
5.4.190.0170.04319.20
5.4.180.0030.08019.10
5.4.170.0200.06319.33
5.4.160.0070.07319.09
5.4.150.0030.06719.34
5.4.140.0030.04716.63
5.4.130.0000.07316.59
5.4.120.0030.07016.43
5.4.110.0130.06316.74
5.4.100.0100.07016.59
5.4.90.0030.04716.74
5.4.80.0000.04016.55
5.4.70.0100.05316.72
5.4.60.0070.06716.59
5.4.50.0070.05016.55
5.4.40.0070.05716.55
5.4.30.0030.08016.58
5.4.20.0030.04016.52
5.4.10.0130.03316.55
5.4.00.0100.07016.08
5.3.290.0000.03714.87
5.3.280.0100.06014.80
5.3.270.0100.06314.72
5.3.260.0100.07714.66
5.3.250.0030.06314.77
5.3.240.0070.07714.66
5.3.230.0130.07314.75
5.3.220.0030.07314.71
5.3.210.0130.03314.75
5.3.200.0100.07314.76
5.3.190.0130.07314.72
5.3.180.0070.06714.76
5.3.170.0070.04014.67
5.3.160.0070.08014.62
5.3.150.0130.07314.62
5.3.140.0000.07714.77
5.3.130.0070.05314.73
5.3.120.0070.03314.70
5.3.110.0030.07014.75
5.3.100.0070.06714.22
5.3.90.0100.07314.20
5.3.80.0030.06014.20
5.3.70.0070.04014.25
5.3.60.0100.06314.24
5.3.50.0030.07014.15
5.3.40.0000.04714.15
5.3.30.0030.06314.07
5.3.20.0100.06313.80
5.3.10.0030.03713.81
5.3.00.0030.07313.75
5.2.170.0100.02311.25
5.2.160.0070.06011.30
5.2.150.0000.05711.35
5.2.140.0070.03311.35
5.2.130.0030.05711.34
5.2.120.0000.04311.20
5.2.110.0100.02311.16
5.2.100.0100.05711.21
5.2.90.0130.05311.31
5.2.80.0100.05311.19
5.2.70.0070.05711.26
5.2.60.0130.05711.25
5.2.50.0030.05711.18
5.2.40.0030.06011.20
5.2.30.0030.06011.18
5.2.20.0030.04311.14
5.2.10.0070.06011.04
5.2.00.0030.06010.86
5.1.60.0000.03710.24
5.1.50.0030.03010.20
5.1.40.0130.04710.21
5.1.30.0030.05010.53
5.1.20.0030.03310.54
5.1.10.0000.05710.25
5.1.00.0070.05310.26
5.0.50.0070.0408.61
5.0.40.0100.0378.46
5.0.30.0070.0638.23
5.0.20.0000.0278.23
5.0.10.0100.0338.26
5.0.00.0030.0638.23
4.4.90.0000.0208.23
4.4.80.0000.0378.23
4.4.70.0030.0338.23
4.4.60.0030.0308.23
4.4.50.0030.0378.23
4.4.40.0070.0508.23
4.4.30.0070.0308.23
4.4.20.0000.0378.23
4.4.10.0000.0378.23
4.4.00.0030.0508.23
4.3.110.0000.0408.23
4.3.100.0000.0308.23
4.3.90.0030.0338.23
4.3.80.0070.0378.23
4.3.70.0000.0208.23
4.3.60.0000.0338.23
4.3.50.0000.0238.23
4.3.40.0000.0538.23
4.3.30.0070.0178.23
4.3.20.0000.0238.23
4.3.10.0000.0338.23
4.3.00.0000.0378.23

preferences:
62.91 ms | 401 KiB | 5 Q