3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1'><a href=\"aaaa\">AAA</a></child> <child name='Child2'>BBBB</child> <subparent> <child name='Child3'>CCCC</child> </subparent> </parent> <child name='Child4'>DDDD</child> </root>"; $xml = simplexml_load_string( $xml); foreach( $xml->xpath( './/child[position() = 2]') as $child) { echo $child. "\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.70.0180.00016.50
8.3.60.0120.00618.39
8.3.50.0120.00416.79
8.3.40.0120.00319.01
8.3.30.0060.00918.84
8.3.20.0050.00318.92
8.3.10.0000.00820.91
8.3.00.0060.01319.63
8.2.180.0110.00716.98
8.2.170.0140.00422.96
8.2.160.0100.00622.34
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.98
8.2.110.0030.00721.40
8.2.100.0000.01218.18
8.2.90.0030.00619.53
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0030.00618.18
8.2.50.0000.00818.10
8.2.40.0070.01020.52
8.2.30.0040.00418.32
8.2.20.0000.00817.80
8.2.10.0000.00818.03
8.2.00.0040.00418.12
8.1.280.0040.01125.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00322.44
8.1.230.0080.00421.16
8.1.220.0040.00418.16
8.1.210.0050.00318.77
8.1.200.0060.00317.49
8.1.190.0050.00319.38
8.1.180.0000.00818.10
8.1.170.0000.00818.96
8.1.160.0040.00419.25
8.1.150.0060.00318.98
8.1.140.0070.00017.81
8.1.130.0000.00718.09
8.1.120.0000.00717.70
8.1.110.0070.00017.69
8.1.100.0030.00617.80
8.1.90.0040.00417.89
8.1.80.0050.00217.62
8.1.70.0040.00417.62
8.1.60.0000.00817.77
8.1.50.0070.00417.69
8.1.40.0040.00417.93
8.1.30.0040.00417.77
8.1.20.0030.00517.80
8.1.10.0030.00617.85
8.1.00.0040.00417.87
8.0.300.0040.00418.77
8.0.290.0060.00316.88
8.0.280.0040.00418.76
8.0.270.0070.00017.63
8.0.260.0030.00317.20
8.0.250.0080.00017.38
8.0.240.0040.00717.13
8.0.230.0070.00017.21
8.0.220.0030.00317.07
8.0.210.0000.00717.23
8.0.200.0000.00717.32
8.0.190.0000.00817.37
8.0.180.0050.00317.08
8.0.170.0040.00717.09
8.0.160.0040.00417.27
8.0.150.0080.00017.01
8.0.140.0050.00217.14
8.0.130.0000.00613.66
8.0.120.0020.00517.07
8.0.110.0020.00517.27
8.0.100.0040.00417.11
8.0.90.0070.00017.20
8.0.80.0120.00317.28
8.0.70.0000.00717.29
8.0.60.0040.00417.14
8.0.50.0040.00417.07
8.0.30.0110.01117.53
8.0.20.0100.00917.51
8.0.10.0000.00817.22
8.0.00.0110.00817.10
7.4.330.0030.00313.43
7.4.320.0070.00016.88
7.4.300.0000.00716.86
7.4.290.0000.00716.84
7.4.280.0040.00416.82
7.4.270.0050.00316.92
7.4.260.0060.00013.70
7.4.250.0080.00016.84
7.4.240.0050.00316.83
7.4.230.0000.00716.82
7.4.220.0070.01116.79
7.4.210.0050.01016.90
7.4.200.0080.00016.85
7.4.190.0040.00416.92
7.4.160.0070.00716.67
7.4.150.0090.00917.40
7.4.140.0100.00817.28
7.4.130.0070.01016.84
7.4.120.0060.01316.88
7.4.110.0110.01116.63
7.4.100.0100.00716.77
7.4.90.0100.00716.84
7.4.80.0110.00719.03
7.4.70.0080.00916.88
7.4.60.0100.00716.71
7.4.50.0000.00816.67
7.4.40.0110.00422.27
7.4.30.0080.00816.77
7.4.00.0030.01215.00
7.3.330.0000.00613.39
7.3.320.0070.00013.39
7.3.310.0000.00816.68
7.3.300.0070.00016.68
7.3.290.0030.01316.72
7.3.280.0100.00716.55
7.3.270.0100.00717.40
7.3.260.0120.00618.24
7.3.250.0040.01616.71
7.3.240.0000.01616.91
7.3.230.0150.00316.93
7.3.210.0070.01016.73
7.3.200.0120.00619.39
7.3.190.0060.01116.84
7.3.180.0030.01616.46
7.3.170.0090.00916.56
7.3.160.0040.01116.71
7.3.120.0070.00714.74
7.3.110.0000.01214.96
7.3.100.0100.00314.62
7.3.90.0040.00814.95
7.3.80.0030.00714.58
7.3.70.0000.01414.71
7.3.60.0110.00014.93
7.3.50.0060.00914.63
7.3.40.0000.01414.66
7.3.30.0060.00915.12
7.3.20.0070.00316.56
7.3.10.0030.00916.74
7.3.00.0040.00916.66
7.2.330.0130.00617.07
7.2.320.0070.01017.17
7.2.310.0090.01516.70
7.2.300.0140.00316.85
7.2.290.0070.01416.82
7.2.240.0100.00015.25
7.2.230.0000.01315.26
7.2.220.0030.00715.29
7.2.210.0110.00415.01
7.2.200.0120.00015.25
7.2.190.0070.00715.34
7.2.180.0120.00314.98
7.2.170.0030.00814.95
7.2.160.0100.00314.91
7.2.150.0040.00417.22
7.2.140.0090.00617.03
7.2.130.0020.01216.92
7.2.120.0050.00917.08
7.2.110.0050.00817.02
7.2.100.0050.00817.16
7.2.90.0020.01317.05
7.2.80.0020.01117.05
7.2.70.0070.00716.99
7.2.60.0100.00417.08
7.2.50.0030.00817.10
7.2.40.0070.00917.25
7.2.30.0090.00717.15
7.2.20.0070.00717.03
7.2.10.0090.00317.04
7.2.00.0100.00317.85
7.1.330.0000.00915.96
7.1.320.0000.01315.81
7.1.310.0080.00416.05
7.1.300.0030.00915.86
7.1.290.0030.00615.91
7.1.280.0070.00315.84
7.1.270.0030.00715.95
7.1.260.0060.00915.62
7.1.250.0060.00615.91
7.1.100.0080.00418.29
7.1.70.0040.00717.44
7.1.60.0120.01219.40
7.1.50.0070.01416.88
7.1.00.0030.07722.78
7.0.200.0050.00217.13
7.0.140.0030.07322.19
7.0.60.0130.07720.12
7.0.50.0100.07318.05
7.0.40.0200.04317.89
7.0.30.0070.06717.96
7.0.20.0030.08717.86
7.0.10.0000.05017.88
7.0.00.0130.08017.88
5.6.280.0030.07321.11
5.6.210.0100.03720.91
5.6.200.0070.08018.37
5.6.190.0100.04318.36
5.6.180.0070.08018.41
5.6.170.0100.06318.32
5.6.160.0030.05318.37
5.6.150.0070.04018.37
5.6.140.0070.08718.39
5.6.130.0070.08318.36
5.6.120.0100.08318.36
5.6.110.0070.08018.36
5.6.100.0070.08018.30
5.6.90.0070.04718.34
5.6.80.0130.07017.72
5.6.70.0130.07317.74
5.6.60.0070.04717.68
5.6.50.0000.05017.70
5.6.40.0070.06017.69
5.6.30.0070.06317.72
5.6.20.0000.05017.71
5.6.10.0030.04017.67
5.6.00.0130.07717.70
5.5.350.0170.07020.56
5.5.340.0130.07718.16
5.5.330.0130.04318.17
5.5.320.0030.04318.20
5.5.310.0230.06718.13
5.5.300.0000.04718.06
5.5.290.0030.07018.16
5.5.280.0030.08718.18
5.5.270.0030.09318.21
5.5.260.0100.07718.11
5.5.250.0100.06317.97
5.5.240.0000.08317.56
5.5.230.0030.07717.50
5.5.220.0200.06717.54
5.5.210.0100.04717.47
5.5.200.0170.07017.54
5.5.190.0030.05317.44
5.5.180.0130.07317.54
5.5.160.0070.08017.45
5.5.150.0030.06717.52
5.5.140.0070.05717.52
5.5.130.0100.07717.56
5.5.120.0130.07017.46
5.5.110.0100.07317.46
5.5.100.0070.04717.39
5.5.90.0100.07317.39
5.5.80.0130.07317.35
5.5.70.0130.07717.43
5.5.60.0000.08017.33
5.5.50.0070.07317.37
5.5.40.0030.04717.34
5.5.30.0070.06017.40
5.5.20.0130.07017.36
5.5.10.0070.05317.30
5.5.00.0130.07017.32
5.4.450.0070.06719.53
5.4.440.0130.06019.45
5.4.430.0070.08019.68
5.4.420.0070.05719.30
5.4.410.0070.04019.24
5.4.400.0100.07018.98
5.4.390.0070.04719.23
5.4.380.0030.07019.18
5.4.370.0130.05319.23
5.4.360.0170.06719.05
5.4.350.0070.08019.23
5.4.340.0000.08719.20
5.4.320.0130.07719.25
5.4.310.0030.07019.25
5.4.300.0100.07719.20
5.4.290.0070.07019.27
5.4.280.0070.07019.27
5.4.270.0030.07319.35
5.4.260.0070.05019.25
5.4.250.0070.06319.20
5.4.240.0130.07319.21
5.4.230.0070.07719.33
5.4.220.0030.06019.20
5.4.210.0070.05719.24
5.4.200.0000.05019.12
5.4.190.0170.06719.23
5.4.180.0070.06019.27
5.4.170.0100.04319.04
5.4.160.0170.05719.17
5.4.150.0100.08019.24
5.4.140.0070.07016.48
5.4.130.0030.04016.57
5.4.120.0070.06716.43
5.4.110.0070.07316.52
5.4.100.0070.07316.64
5.4.90.0130.06316.50
5.4.80.0070.06016.55
5.4.70.0130.05016.46
5.4.60.0030.07316.49
5.4.50.0070.03716.60
5.4.40.0130.05716.61
5.4.30.0130.06316.41
5.4.20.0070.07316.45
5.4.10.0100.06316.52
5.4.00.0170.03715.80
5.3.290.0070.05014.86
5.3.280.0030.08014.70
5.3.270.0070.04014.72
5.3.260.0030.05014.79
5.3.250.0000.05714.74
5.3.240.0130.07014.64
5.3.230.0030.07314.65
5.3.220.0030.07014.60
5.3.210.0070.04714.79
5.3.200.0030.05314.55
5.3.190.0100.05014.76
5.3.180.0070.08014.72
5.3.170.0070.06314.65
5.3.160.0070.07014.73
5.3.150.0030.06714.77
5.3.140.0030.08014.74
5.3.130.0200.06314.75
5.3.120.0030.05314.58
5.3.110.0070.06714.73
5.3.100.0070.07314.02
5.3.90.0070.08014.10
5.3.80.0030.08314.13
5.3.70.0070.06314.02
5.3.60.0070.07713.96
5.3.50.0130.06713.93
5.3.40.0000.06314.05
5.3.30.0170.05014.07
5.3.20.0100.05713.86
5.3.10.0030.07313.84
5.3.00.0100.05313.60
5.2.170.0100.03311.40
5.2.160.0130.05311.29
5.2.150.0000.05011.39
5.2.140.0100.06011.27
5.2.130.0000.03711.13
5.2.120.0030.03011.21
5.2.110.0000.06711.09
5.2.100.0030.04711.33
5.2.90.0030.03311.22
5.2.80.0030.03011.32
5.2.70.0000.03711.33
5.2.60.0000.03011.20
5.2.50.0000.03011.13
5.2.40.0030.03011.25
5.2.30.0070.02310.97
5.2.20.0030.02710.99
5.2.10.0030.02711.00
5.2.00.0000.03010.96
5.1.60.0000.02310.14
5.1.50.0000.02710.14
5.1.40.0030.02010.16
5.1.30.0030.02310.50
5.1.20.0070.02010.63
5.1.10.0000.02710.24
5.1.00.0070.02010.36
5.0.50.0000.0208.78
5.0.40.0030.0278.57
5.0.30.0070.0278.28
5.0.20.0000.0238.38
5.0.10.0000.0208.28
5.0.00.0030.0278.39
4.4.90.0000.0178.28
4.4.80.0030.0138.28
4.4.70.0000.0178.28
4.4.60.0000.0178.28
4.4.50.0030.0138.28
4.4.40.0000.0238.28
4.4.30.0070.0108.28
4.4.20.0000.0178.28
4.4.10.0000.0178.28
4.4.00.0000.0278.28
4.3.110.0000.0178.28
4.3.100.0000.0138.28
4.3.90.0000.0138.28
4.3.80.0030.0208.28
4.3.70.0000.0178.28
4.3.60.0000.0138.28
4.3.50.0030.0138.28
4.3.40.0000.0238.28
4.3.30.0000.0178.28
4.3.20.0000.0178.28
4.3.10.0000.0138.28
4.3.00.0000.0178.28

preferences:
49.26 ms | 401 KiB | 5 Q