3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <texts> <text> <paragraph/> First text <paragraph/> Second text </text> <text> <paragraph/> Third text <paragraph/> Fourth text </text> </texts> DATA; $doc = new DOMDocument(); $doc->loadXML($data); $xpath = new DOMXpath($doc); $i = 1; $expression = "//text/text()"; foreach ($xpath->query($expression) as $text) { $result = trim($text->nodeValue); if ($result !== "") { echo sprintf("%d | %s<br>", $i++, $result); } }

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.130.0000.01618.78
8.3.120.0070.00721.01
8.3.110.0030.00617.10
8.3.100.0060.00318.84
8.3.90.0110.00316.95
8.3.80.0030.00618.81
8.3.70.0070.01117.13
8.3.60.0060.01218.56
8.3.50.0080.00516.67
8.3.40.0160.00619.13
8.3.30.0000.01518.91
8.3.20.0070.00022.10
8.3.10.0050.00324.03
8.3.00.0000.00923.90
8.2.250.0110.00819.66
8.2.240.0100.00317.40
8.2.230.0060.01220.94
8.2.220.0030.00624.06
8.2.210.0120.00326.77
8.2.200.0090.00318.79
8.2.190.0110.00416.85
8.2.180.0150.00620.40
8.2.170.0100.00622.96
8.2.160.0110.00422.63
8.2.150.0090.00024.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0050.00221.42
8.2.110.0060.00322.69
8.2.100.0080.00318.09
8.2.90.0070.00418.27
8.2.80.0060.00318.41
8.2.70.0050.00318.28
8.2.60.0090.00017.88
8.2.50.0000.00818.41
8.2.40.0000.00920.88
8.2.30.0040.00422.83
8.2.20.0020.00518.50
8.2.10.0060.00318.44
8.2.00.0000.00718.45
8.1.300.0090.00018.32
8.1.290.0030.00618.88
8.1.280.0040.01125.92
8.1.270.0080.00023.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00724.03
8.1.230.0090.00322.92
8.1.220.0050.00318.05
8.1.210.0040.00419.06
8.1.200.0000.00817.73
8.1.190.0000.00817.60
8.1.180.0000.00818.10
8.1.170.0040.00418.77
8.1.160.0000.00719.29
8.1.150.0070.00220.66
8.1.140.0050.00218.07
8.1.130.0060.00319.30
8.1.120.0000.00717.87
8.1.110.0000.00817.69
8.1.100.0050.00317.83
8.1.90.0050.00317.68
8.1.80.0000.01017.77
8.1.70.0110.00017.91
8.1.60.0050.00517.81
8.1.50.0080.00017.75
8.1.40.0030.00517.71
8.1.30.0000.00917.73
8.1.20.0040.00417.99
8.1.10.0000.00817.90
8.1.00.0080.00017.95
8.0.300.0040.00420.20
8.0.290.0040.00417.13
8.0.280.0070.00018.77
8.0.270.0040.00417.67
8.0.260.0070.00017.26
8.0.250.0050.00517.45
8.0.240.0020.00517.46
8.0.230.0000.00717.38
8.0.220.0040.00417.31
8.0.210.0000.00717.38
8.0.200.0040.00417.24
8.0.190.0030.00517.32
8.0.180.0050.00217.17
8.0.170.0040.00417.33
8.0.160.0050.00617.22
8.0.150.0070.00017.15
8.0.140.0030.00317.11
8.0.130.0000.00613.78
8.0.120.0000.00817.36
8.0.110.0080.00017.36
8.0.100.0000.00717.21
8.0.90.0050.00517.25
8.0.80.0070.00717.27
8.0.70.0040.00417.23
8.0.60.0000.00817.42
8.0.50.0040.00417.18
8.0.30.0120.00817.46
8.0.20.0090.00917.56
8.0.10.0050.00317.41
8.0.00.0180.00317.22
7.4.330.0070.00015.55
7.4.320.0000.00716.97
7.4.300.0060.00016.98
7.4.290.0000.00716.87
7.4.280.0040.00416.81
7.4.270.0030.00316.84
7.4.260.0050.00316.89
7.4.250.0000.00816.82
7.4.240.0000.00716.90
7.4.230.0040.00416.87
7.4.220.0040.00417.02
7.4.210.0060.01117.05
7.4.200.0000.00716.68
7.4.160.0100.00716.79
7.4.140.0120.00817.86
7.4.130.0170.00016.73
7.4.120.0080.01016.92
7.4.110.0120.00616.85
7.4.100.0160.00616.79
7.4.90.0160.00316.86
7.4.80.0080.01119.39
7.4.70.0060.01216.90
7.4.60.0100.00716.88
7.4.50.0150.00016.85
7.4.40.0130.00316.88
7.4.00.0060.00815.19
7.3.330.0030.00313.33
7.3.320.0000.00613.33
7.3.310.0040.00416.79
7.3.300.0040.00416.76
7.3.290.0120.01316.76
7.3.280.0080.01016.59
7.3.260.0120.00916.71
7.3.240.0110.00616.79
7.3.230.0080.00816.96
7.3.210.0080.01116.79
7.3.200.0040.01316.69
7.3.190.0160.00616.75
7.3.180.0040.01216.94
7.3.170.0130.00316.65
7.3.160.0090.01216.73
7.3.120.0120.00615.09
7.3.110.0100.01014.99
7.3.100.0000.01915.19
7.3.90.0000.00915.03
7.3.80.0110.00014.90
7.3.70.0060.00614.99
7.3.60.0060.00615.13
7.3.50.0000.00914.77
7.3.40.0030.00614.69
7.3.30.0060.00914.87
7.3.20.0110.00416.73
7.3.10.0030.00916.91
7.3.00.0060.00316.77
7.2.330.0100.00716.70
7.2.320.0090.00917.13
7.2.310.0060.01316.82
7.2.300.0090.00916.82
7.2.290.0090.00916.82
7.2.250.0090.00915.00
7.2.240.0070.00415.20
7.2.230.0080.00815.02
7.2.220.0060.01215.18
7.2.210.0070.01015.29
7.2.200.0000.01214.88
7.2.190.0030.01015.13
7.2.180.0100.00715.36
7.2.170.0060.00915.39
7.2.160.0110.00715.30
7.2.150.0070.01017.13
7.2.140.0040.01117.11
7.2.130.0070.01017.21
7.2.120.0030.01017.29
7.2.110.0070.00717.00
7.2.100.0090.00017.18
7.2.90.0110.00317.11
7.2.80.0130.00016.90
7.2.70.0060.00917.11
7.2.60.0090.00917.15
7.2.50.0030.01717.01
7.2.40.0040.00816.94
7.2.30.0080.01417.74
7.2.20.0080.01217.59
7.2.10.0100.01117.40
7.2.00.0180.01117.76
7.1.330.0140.00416.08
7.1.320.0040.01216.05
7.1.310.0070.01116.02
7.1.300.0000.00915.90
7.1.290.0070.00715.98
7.1.280.0040.00815.77
7.1.270.0100.00316.25
7.1.260.0000.00916.07
7.1.250.0070.00716.00
7.1.240.0030.01315.98
7.1.230.0060.00615.86
7.1.220.0030.00915.98
7.1.210.0030.00915.92
7.1.200.0050.00515.95
7.1.190.0040.01415.97
7.1.180.0030.01315.86
7.1.170.0030.01316.05
7.1.160.0000.01416.12
7.1.150.0100.01016.48
7.1.140.0080.00916.33
7.1.130.0110.01116.37
7.1.120.0100.00916.23
7.1.110.0110.00716.02
7.1.100.0080.01216.13
7.1.90.0070.00816.25
7.1.80.0070.00816.04
7.1.70.0070.00715.62
7.1.60.0140.01324.56
7.1.50.0220.01324.50
7.1.40.0160.01124.46
7.1.30.0180.01224.42
7.1.20.0190.01224.39
7.1.10.0060.00815.45
7.1.00.0080.00815.34
7.0.330.0090.00015.60
7.0.320.0100.00315.59
7.0.310.0040.00415.73
7.0.300.0000.01315.63
7.0.290.0030.00615.36
7.0.280.0040.00815.52
7.0.270.0040.00715.61
7.0.260.0070.01015.70
7.0.250.0060.01215.70
7.0.240.0100.00315.75
7.0.230.0040.00815.84
7.0.220.0000.01215.81
7.0.210.0060.00915.65
7.0.200.0070.01115.64
7.0.190.0000.01015.68
7.0.180.0060.00615.80
7.0.170.0040.00815.71
7.0.160.0060.00615.54
7.0.150.0030.00515.65
7.0.140.0080.00815.64
7.0.130.0100.00315.44
7.0.120.0070.00715.68
7.0.110.0100.00315.60
7.0.100.0050.00815.64
7.0.90.0120.00615.61
7.0.80.0040.01115.45
7.0.70.0040.00815.63
7.0.60.0000.01215.58
7.0.50.0070.00315.84
7.0.40.0120.00013.69
7.0.30.0070.00713.53
7.0.20.0070.00713.85
7.0.10.0030.00713.57
7.0.00.0090.00013.73
5.6.400.0090.00014.63
5.6.390.0040.00414.34
5.6.380.0000.01314.25
5.6.370.0090.00014.64
5.6.360.0030.01314.86
5.6.350.0040.01214.51
5.6.340.0070.01014.48
5.6.330.0030.00914.89
5.6.320.0030.01414.90
5.6.310.0100.00014.91
5.6.300.0140.00014.66
5.6.290.0090.00614.64
5.6.280.0120.00314.29
5.6.270.0060.00314.51
5.6.260.0060.00314.87
5.6.250.0040.00714.84
5.6.240.0030.01314.41
5.6.230.0090.00914.44
5.6.220.0080.00814.29
5.6.210.0090.00314.48
5.6.200.0090.00614.25
5.6.190.0040.01114.32
5.6.180.0030.00614.51
5.6.170.0070.00714.32
5.6.160.0000.01014.39
5.6.150.0120.00314.35
5.6.140.0040.01114.79
5.6.130.0040.01214.42
5.6.120.0000.01014.22
5.6.110.0030.01014.19
5.6.100.0090.00614.33
5.6.90.0030.01414.61
5.6.80.0100.01014.66
5.6.70.0130.00314.53
5.6.60.0060.00614.25
5.6.50.0050.00814.15
5.6.40.0060.00614.14
5.6.30.0030.01214.17
5.6.20.0070.00714.20
5.6.10.0070.01014.13
5.6.00.0060.00914.38

preferences:
29.39 ms | 403 KiB | 5 Q