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->childNode 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.68
8.3.50.0130.00618.69
8.3.40.0040.01119.21
8.3.30.0070.00718.84
8.3.20.0080.00020.58
8.3.10.0000.00821.16
8.3.00.0080.00021.26
8.2.180.0150.00018.74
8.2.170.0030.01222.96
8.2.160.0140.00019.57
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0090.00018.46
8.2.120.0030.00626.35
8.2.110.0050.00522.63
8.2.100.0090.00318.28
8.2.90.0050.00519.52
8.2.80.0060.00318.18
8.2.70.0080.00017.88
8.2.60.0000.00818.16
8.2.50.0050.00318.28
8.2.40.0030.00622.78
8.2.30.0060.00319.56
8.2.20.0050.00218.42
8.2.10.0050.00218.49
8.2.00.0050.00318.30
8.1.280.0120.00625.92
8.1.270.0040.00422.61
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0030.00624.13
8.1.230.0040.00722.38
8.1.220.0040.00418.05
8.1.210.0040.00418.77
8.1.200.0090.00017.73
8.1.190.0000.00817.63
8.1.180.0070.00418.10
8.1.170.0050.00318.75
8.1.160.0070.00019.41
8.1.150.0040.00419.18
8.1.140.0030.00619.90
8.1.130.0000.00719.19
8.1.120.0000.00817.89
8.1.110.0050.00317.93
8.1.100.0040.00417.87
8.1.90.0050.00317.89
8.1.80.0000.00817.84
8.1.70.0070.00017.71
8.1.60.0050.00318.02
8.1.50.0000.00817.79
8.1.40.0060.00617.84
8.1.30.0040.00418.10
8.1.20.0060.00317.79
8.1.10.0090.00017.68
8.1.00.0040.00417.87
8.0.300.0090.00018.77
8.0.290.0040.00417.13
8.0.280.0040.00418.80
8.0.270.0070.00017.55
8.0.260.0000.00721.06
8.0.250.0030.00317.45
8.0.240.0040.00417.48
8.0.230.0050.00217.42
8.0.220.0070.00017.34
8.0.210.0030.00517.42
8.0.200.0070.00017.25
8.0.190.0080.00017.21
8.0.180.0040.00417.38
8.0.170.0000.00717.40
8.0.160.0050.00317.41
8.0.150.0000.00717.15
8.0.140.0000.00817.34
8.0.130.0060.00013.78
8.0.120.0050.00317.32
8.0.110.0050.00217.23
8.0.100.0070.00017.28
8.0.90.0040.00417.43
8.0.80.0140.00417.30
8.0.70.0050.00217.21
8.0.60.0040.00417.27
8.0.50.0030.00517.20
8.0.30.0120.00817.36
8.0.20.0100.00817.46
8.0.10.0050.00317.30
8.0.00.0180.00017.20
7.4.330.0000.00515.55
7.4.320.0060.00016.71
7.4.300.0030.00316.98
7.4.290.0000.00916.89
7.4.280.0040.00416.82
7.4.270.0000.00716.81
7.4.260.0070.00016.95
7.4.250.0070.00016.74
7.4.240.0000.00716.81
7.4.230.0000.00716.85
7.4.220.0070.01116.97
7.4.210.0070.00816.89
7.4.200.0070.00016.99
7.4.160.0110.00816.82
7.4.150.0120.00617.40
7.4.140.0080.01117.86
7.4.130.0090.01516.88
7.4.120.0090.01216.91
7.4.110.0040.01216.91
7.4.100.0070.01316.79
7.4.90.0080.00816.76
7.4.80.0040.01419.39
7.4.70.0090.00916.82
7.4.60.0060.01116.72
7.4.50.0070.00716.76
7.4.40.0100.00716.80
7.4.30.0070.01016.94
7.4.00.0060.00914.99
7.3.330.0060.00013.36
7.3.320.0030.00313.49
7.3.310.0030.00516.46
7.3.300.0030.00316.61
7.3.290.0000.00716.49
7.3.280.0070.01016.55
7.3.270.0100.00717.40
7.3.260.0030.01416.80
7.3.250.0080.01016.70
7.3.240.0080.01016.72
7.3.230.0150.00316.92
7.3.210.0110.00716.81
7.3.200.0040.01216.64
7.3.190.0150.00316.80
7.3.180.0060.01016.53
7.3.170.0150.00616.77
7.3.160.0130.00316.59
7.3.10.0080.00316.51
7.3.00.0120.00016.68
7.2.330.0100.00716.90
7.2.320.0100.01316.86
7.2.310.0000.01616.98
7.2.300.0100.00716.88
7.2.290.0100.00716.77
7.2.130.0050.00517.06
7.2.120.0000.01217.01
7.2.110.0030.00617.02
7.2.100.0000.01116.83
7.2.90.0060.00917.43
7.2.80.0060.00317.10
7.2.70.0030.00717.28
7.2.60.0030.01116.81
7.2.50.0080.00816.96
7.2.40.0090.00617.18
7.2.30.0030.01017.12
7.2.20.0030.00617.09
7.2.10.0000.00916.93
7.2.00.0100.00717.11
7.1.250.0000.00816.02
7.1.200.0070.00715.98
7.1.70.0030.01217.27
7.1.60.0200.01334.95
7.1.50.0240.00634.73
7.1.40.0220.01534.68
7.1.30.0190.01734.76
7.1.20.0180.01934.80
7.1.10.0060.00916.76
7.1.00.0000.01716.87
7.0.200.0030.01016.84
7.0.190.0050.00916.73
7.0.180.0040.01216.41
7.0.170.0030.01316.43
7.0.160.0040.01316.57
7.0.150.0000.01616.34
7.0.140.0080.01016.57
7.0.130.0060.01216.68
7.0.120.0090.00916.62
7.0.110.0000.01716.51
7.0.100.0000.01616.54
7.0.90.0000.01716.54
7.0.80.0070.01016.54
7.0.70.0080.00516.51
7.0.60.0040.01116.30
7.0.50.0000.01516.52
7.0.40.0030.01016.57
7.0.30.0080.00816.69
7.0.20.0080.00716.71
7.0.10.0100.00616.55
7.0.00.0100.00716.53

preferences:
53.92 ms | 401 KiB | 5 Q