3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str='<root> <book id="1"> <title>..1.</title> <author>.1..</author> </book> <book id="2"> <title>.2..</title> <author>.2..</author> </book> <book id="3"> <title>.3..</title> <author>.3..</author> </book> </root>'; $dom = new DOMDocument; $dom->loadXML($str); $xpath = new DOMXPath($dom); $book = $xpath->query("//book[@id='3']")->item(0); //echo $book->title; foreach($book as $node) { $pattern = "/<'title'>(.*)<\/'title'>/"; preg_match($pattern, $node, $matches, PREG_OFFSET_CAPTURE); echo $matches; } //echo $html; ?>

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.0130.00618.93
8.3.50.0090.00918.41
8.3.40.0040.01119.35
8.3.30.0060.00919.08
8.3.20.0090.00020.71
8.3.10.0030.00521.23
8.3.00.0030.00521.01
8.2.180.0000.01618.89
8.2.170.0140.00022.96
8.2.160.0110.00419.84
8.2.150.0090.00024.18
8.2.140.0000.00824.66
8.2.130.0050.00320.16
8.2.120.0030.00326.35
8.2.110.0070.00322.63
8.2.100.0060.00618.24
8.2.90.0050.00319.33
8.2.80.0000.00818.05
8.2.70.0040.00418.13
8.2.60.0030.00518.05
8.2.50.0030.00518.30
8.2.40.0090.00022.66
8.2.30.0030.00619.58
8.2.20.0000.00818.35
8.2.10.0040.00418.45
8.2.00.0040.00418.35
8.1.280.0110.00925.92
8.1.270.0040.00422.51
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.46
8.1.230.0040.00819.47
8.1.220.0000.00918.16
8.1.210.0040.00418.77
8.1.200.0090.00317.98
8.1.190.0100.00217.63
8.1.180.0060.00318.10
8.1.170.0000.00819.07
8.1.160.0040.00419.38
8.1.150.0000.00819.10
8.1.140.0080.00019.98
8.1.130.0030.00319.19
8.1.120.0080.00017.97
8.1.110.0040.00417.82
8.1.100.0000.00917.76
8.1.90.0040.00417.87
8.1.80.0000.00717.99
8.1.70.0030.00317.84
8.1.60.0000.00818.11
8.1.50.0040.00418.10
8.1.40.0080.00317.96
8.1.30.0060.00318.26
8.1.20.0090.00018.16
8.1.10.0040.00417.97
8.1.00.0000.00817.79
8.0.300.0030.00518.77
8.0.290.0030.00517.00
8.0.280.0000.00718.72
8.0.270.0070.00017.56
8.0.260.0050.00219.29
8.0.250.0000.00717.32
8.0.240.0080.00017.18
8.0.230.0000.00717.31
8.0.220.0040.00417.12
8.0.210.0040.00417.05
8.0.200.0060.00017.31
8.0.190.0030.00617.14
8.0.180.0000.00717.16
8.0.170.0050.00317.33
8.0.160.0050.00317.10
8.0.150.0000.00717.02
8.0.140.0040.00417.06
8.0.130.0060.00013.52
8.0.120.0040.00417.27
8.0.110.0070.00017.15
8.0.100.0040.00417.14
8.0.90.0040.00417.04
8.0.80.0090.00917.22
8.0.70.0070.00017.09
8.0.60.0050.00317.27
8.0.50.0000.00717.27
8.0.30.0110.00717.42
8.0.20.0060.01217.42
8.0.10.0030.00517.23
8.0.00.0070.01017.09
7.4.330.0020.00215.58
7.4.320.0030.00316.93
7.4.300.0040.00416.88
7.4.290.0030.00616.88
7.4.280.0070.00016.91
7.4.270.0040.00416.82
7.4.260.0080.00017.01
7.4.250.0000.00716.71
7.4.240.0040.00416.81
7.4.230.0000.00717.09
7.4.220.0130.00616.95
7.4.210.0090.00816.94
7.4.200.0070.00017.08
7.4.160.0080.00916.76
7.4.150.0070.01117.40
7.4.140.0100.01017.86
7.4.130.0150.00616.67
7.4.120.0140.00616.72
7.4.110.0060.01216.68
7.4.100.0100.00716.80
7.4.90.0060.01216.83
7.4.80.0130.01019.39
7.4.70.0120.00616.94
7.4.60.0030.01316.69
7.4.50.0110.00716.63
7.4.40.0030.01716.65
7.4.30.0060.01216.58
7.4.10.0030.01615.16
7.4.00.0080.01014.84
7.3.330.0050.00013.52
7.3.320.0030.00313.55
7.3.310.0030.00316.65
7.3.300.0050.00216.64
7.3.290.0030.00316.54
7.3.280.0070.01116.65
7.3.270.0140.00617.40
7.3.260.0100.00716.73
7.3.250.0080.01116.75
7.3.240.0120.00516.71
7.3.230.0150.00316.66
7.3.210.0040.01416.92
7.3.200.0130.00616.58
7.3.190.0100.00616.90
7.3.180.0080.00816.86
7.3.170.0120.00816.68
7.3.160.0080.00816.79
7.3.130.0130.00315.24
7.3.120.0070.01115.07
7.3.110.0060.01314.89
7.3.100.0070.01014.78
7.3.90.0000.01314.83
7.3.80.0000.01214.90
7.3.70.0060.00614.91
7.3.60.0100.00614.92
7.3.50.0060.00614.98
7.3.40.0060.00314.68
7.3.30.0030.00914.79
7.3.20.0060.00616.58
7.3.10.0040.00816.84
7.3.00.0040.00416.81
7.2.330.0060.01317.13
7.2.320.0100.00716.98
7.2.310.0110.00617.13
7.2.300.0100.00716.84
7.2.290.0080.01016.78
7.2.260.0120.00615.15
7.2.250.0030.01315.57
7.2.240.0040.01115.16
7.2.230.0000.01715.33
7.2.220.0090.00015.07
7.2.210.0030.00614.95
7.2.200.0030.01015.00
7.2.190.0030.01215.07
7.2.180.0000.01215.09
7.2.170.0120.00315.26
7.2.160.0070.00415.10
7.2.150.0080.00817.45
7.2.140.0040.01217.01
7.2.130.0030.00716.89
7.2.120.0040.01017.25
7.2.110.0060.01017.14
7.2.100.0090.00916.91
7.2.90.0070.00717.10
7.2.80.0060.00317.33
7.2.70.0030.00717.18
7.2.60.0050.00716.98
7.2.50.0030.01217.00
7.2.40.0030.00617.38
7.2.30.0080.00817.13
7.2.20.0070.01017.18
7.2.10.0110.00416.99
7.2.00.0070.00716.75
7.1.330.0090.00315.91
7.1.320.0000.01116.02
7.1.310.0000.01015.85
7.1.300.0030.01316.03
7.1.290.0000.01315.91
7.1.280.0030.01015.89
7.1.270.0040.00815.77
7.1.260.0140.00315.83
7.1.250.0060.00615.76
7.1.240.0030.01215.80
7.1.230.0040.01115.96
7.1.220.0070.00315.79
7.1.210.0030.00915.57
7.1.200.0090.00215.85
7.1.190.0040.00716.06
7.1.180.0070.00715.95
7.1.170.0000.01315.78
7.1.160.0060.00615.76
7.1.150.0030.00715.93
7.1.140.0090.00615.93
7.1.130.0100.00315.96
7.1.120.0000.01415.76
7.1.110.0110.00015.55
7.1.100.0040.00815.89
7.1.90.0070.00715.92
7.1.80.0090.00315.75
7.1.70.0060.01016.58
7.1.60.0180.00825.45
7.1.50.0140.01025.38
7.1.40.0120.01025.25
7.1.30.0160.01025.18
7.1.20.0140.01025.20
7.1.10.0060.01116.33
7.1.00.0060.01016.48
7.0.330.0040.00715.51
7.0.320.0040.00715.64
7.0.310.0030.00815.62
7.0.300.0090.00415.58
7.0.290.0000.01515.80
7.0.280.0090.00615.53
7.0.270.0070.00715.61
7.0.260.0030.01015.50
7.0.250.0090.00315.92
7.0.240.0030.01015.67
7.0.230.0030.00915.32
7.0.220.0080.00315.66
7.0.210.0030.00915.59
7.0.200.0080.00816.17
7.0.190.0060.01016.29
7.0.180.0080.00915.92
7.0.170.0080.00916.12
7.0.160.0010.01215.93
7.0.150.0070.01116.04
7.0.140.0090.00716.20
7.0.130.0040.01016.28
7.0.120.0020.01216.25
7.0.110.0080.00816.05
7.0.100.0080.00616.00
7.0.90.0070.00916.11
7.0.80.0050.00816.06
7.0.70.0080.00516.18
7.0.60.0100.00616.02
7.0.50.0060.00916.18
7.0.40.0050.00915.20
7.0.30.0040.01215.09
7.0.20.0120.00515.03
7.0.10.0050.01315.15
7.0.00.0140.00115.11
5.6.400.0030.01014.90
5.6.390.0110.00414.57
5.6.380.0060.00314.44
5.6.370.0100.00614.36
5.6.360.0030.00514.49
5.6.350.0040.00814.70
5.6.340.0060.00914.59
5.6.330.0040.00814.59
5.6.320.0100.00314.41
5.6.310.0030.00614.87
5.6.300.0030.01314.70
5.6.290.0040.01114.58
5.6.280.0040.00714.31
5.6.270.0000.01014.51
5.6.260.0000.01214.39
5.6.250.0070.00714.56
5.6.240.0060.00614.70
5.6.230.0040.00814.49
5.6.220.0060.01014.67
5.6.210.0000.00914.26
5.6.200.0060.00614.56
5.6.190.0030.00614.39
5.6.180.0030.01014.42
5.6.170.0030.01014.66
5.6.160.0060.01214.56
5.6.150.0030.01214.53
5.6.140.0000.01814.63
5.6.130.0110.00414.22
5.6.120.0030.00714.66
5.6.110.0060.00614.32
5.6.100.0030.01214.70
5.6.90.0110.00314.96
5.6.80.0080.00314.35
5.6.70.0000.01014.45
5.6.60.0030.01314.25
5.6.50.0050.00514.24
5.6.40.0130.00014.53
5.6.30.0040.01514.50
5.6.20.0060.00614.43
5.6.10.0060.00614.10
5.6.00.0070.00314.23

preferences:
62.98 ms | 400 KiB | 5 Q