3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rawxml = '<?xml version="1.0"?><root><field attr1="val1"><field attr1="val1"/></field></root>'; $rawxpath = "/root[1]/field[@attr1='val1']"; $results = array(); for ($i = 0; $i < 10000; $i++) { $xmlDocument = new DOMDocument(); $xmlDocument->loadXML($rawxml); $xp = new DOMXPath($xmlDocument); $xpr = $xp->evaluate($rawxpath, $xmlDocument->documentElement); if (isset($results[(string) $xpr->length])) $results[(string) $xpr->length]++; else $results[(string) $xpr->length] = 1; } foreach ($results as $matches => $count) printf("In %5d instances, found $matches match(es) for $rawxpath\n", $count);

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.0170.12818.89
8.3.50.0180.12821.21
8.3.40.0200.12819.17
8.3.30.0170.13520.77
8.3.20.0130.06619.11
8.3.10.0160.06221.33
8.3.00.0130.06722.71
8.2.180.0130.14717.13
8.2.170.0330.11322.96
8.2.160.0130.13020.77
8.2.150.0030.07524.18
8.2.140.0070.07524.66
8.2.130.0100.06826.16
8.2.120.0030.07721.27
8.2.110.0070.09021.50
8.2.100.0030.12118.41
8.2.90.0070.11119.55
8.2.80.0100.10618.00
8.2.70.0140.10318.13
8.2.60.0130.12018.16
8.2.50.0030.11418.07
8.2.40.0030.11318.66
8.2.30.0070.11118.58
8.2.20.0070.11018.23
8.2.10.0100.10618.13
8.2.00.0100.10618.09
8.1.280.0170.12825.92
8.1.270.0100.06723.99
8.1.260.0130.06626.35
8.1.250.0000.07928.09
8.1.240.0160.07521.81
8.1.230.0100.11517.85
8.1.220.0070.11018.04
8.1.210.0100.10918.77
8.1.200.0070.11317.85
8.1.190.0070.10817.85
8.1.180.0070.10918.10
8.1.170.0130.10519.27
8.1.160.0100.10819.09
8.1.150.0130.10319.05
8.1.140.0100.10817.73
8.1.130.0030.10918.19
8.1.120.0030.13417.68
8.1.110.0060.10917.87
8.1.100.0070.10917.84
8.1.90.0070.10917.66
8.1.80.0070.10817.66
8.1.70.0160.09817.72
8.1.60.0070.11317.79
8.1.50.0030.11617.98
8.1.40.0070.11317.76
8.1.30.0030.11418.05
8.1.20.0100.11017.92
8.1.10.0260.12918.00
8.1.00.0100.11017.75
8.0.300.0100.10418.77
8.0.290.0130.10217.13
8.0.280.0100.10518.82
8.0.270.0070.10717.75
8.0.260.0100.10317.22
8.0.250.0060.10717.21
8.0.240.0130.10317.40
8.0.230.0100.10617.38
8.0.220.0130.10417.27
8.0.210.0070.11017.26
8.0.200.0000.11217.36
8.0.190.0030.11317.43
8.0.180.0070.11117.34
8.0.170.0130.10417.11
8.0.160.0030.11217.37
8.0.150.0030.11717.04
8.0.140.0070.13417.28
8.0.130.0030.11013.56
8.0.120.0100.10617.15
8.0.110.0030.11117.08
8.0.100.0030.11317.13
8.0.90.0130.10117.13
8.0.80.0630.34417.29
8.0.70.0070.11617.16
8.0.60.0130.10417.22
8.0.50.0170.11717.25
8.0.30.0670.41717.46
8.0.20.0570.33017.52
8.0.10.0030.11217.26
8.0.00.0510.38417.29
7.4.330.0070.10616.95
7.4.320.0070.11016.88
7.4.300.0100.10616.79
7.4.290.0030.11716.77
7.4.280.0070.11916.93
7.4.270.0070.11416.93
7.4.260.0070.11013.71
7.4.250.0100.12416.88
7.4.240.0130.10717.04
7.4.230.0070.11116.94
7.4.220.0360.43416.87
7.4.210.0290.31316.94
7.4.200.0030.11416.84
7.4.190.0030.11516.86
7.4.160.0660.31516.74
7.4.150.0600.32017.40
7.4.140.0600.33017.86
7.4.130.0510.33216.90
7.4.120.0510.33316.90
7.4.110.0430.32516.82
7.4.100.0520.35816.79
7.4.90.0490.35216.89
7.4.80.0520.44419.39
7.4.70.0260.39816.98
7.4.60.0400.31416.83
7.4.50.0160.07416.96
7.4.40.0130.16222.77
7.4.30.0650.33816.92
7.4.10.0240.24316.88
7.4.00.0150.20316.13
7.3.330.0000.11813.62
7.3.320.0070.10813.59
7.3.310.0130.11316.45
7.3.300.0030.11316.64
7.3.290.0360.39716.71
7.3.280.0340.32516.69
7.3.270.0650.31917.40
7.3.260.0540.34718.24
7.3.250.0650.33716.84
7.3.240.0670.40216.89
7.3.230.0540.39917.00
7.3.210.0620.42516.98
7.3.200.0800.47919.39
7.3.190.0260.36316.67
7.3.180.0490.48916.84
7.3.170.0290.34716.58
7.3.160.0360.40416.91
7.3.130.0230.21816.65
7.3.120.0150.20616.00
7.3.110.0200.20816.54
7.3.100.0200.21616.47
7.3.90.0430.24316.36
7.3.80.0100.23217.08
7.3.70.0160.20716.74
7.3.60.0230.17216.77
7.3.50.0070.18816.68
7.3.40.0330.16816.80
7.3.30.0230.23616.59
7.3.20.0200.20818.56
7.3.10.0130.25318.49
7.3.00.0160.18118.56
7.2.330.0840.36817.05
7.2.320.0470.36816.99
7.2.310.0490.34317.14
7.2.300.0480.35716.93
7.2.290.0300.38717.16
7.2.260.0230.31016.76
7.2.250.0230.31217.28
7.2.240.0330.15217.04
7.2.230.0220.26316.65
7.2.220.0370.25017.25
7.2.210.0130.20217.02
7.2.200.0230.20917.16
7.2.190.0130.24316.82
7.2.180.0150.19617.09
7.2.170.0160.23416.84
7.2.160.0270.22716.96
7.2.150.0230.26618.69
7.2.140.0330.22718.81
7.2.130.0260.22918.72
7.2.120.0200.19618.76
7.2.110.0200.18218.81
7.2.100.0070.17918.85
7.2.90.0030.21318.68
7.2.80.0170.21818.76
7.2.70.0200.16719.01
7.2.60.0200.17619.03
7.2.50.0230.25018.64
7.2.40.0230.24318.48
7.2.30.0100.20118.74
7.2.20.0200.25818.82
7.2.10.0330.18818.80
7.2.00.0240.23019.17
7.1.330.0260.21617.45
7.1.320.0200.24417.86
7.1.310.0130.17517.89
7.1.300.0260.22217.56
7.1.290.0070.17517.77
7.1.280.0100.21117.80
7.1.270.0100.27917.67
7.1.260.0230.19217.67
7.1.250.0190.22217.95
7.1.240.0170.24217.57
7.1.230.0130.21817.78
7.1.220.0070.25617.48
7.1.210.0200.17917.55
7.1.200.0130.19417.81
7.1.190.0200.16717.63
7.1.180.0200.18517.90
7.1.170.0130.23317.48
7.1.160.0200.23517.38
7.1.150.0330.20317.52
7.1.140.0130.18517.48
7.1.130.0170.23117.61
7.1.120.0200.22517.54
7.1.110.0130.22317.63
7.1.100.0150.20017.96
7.1.90.0200.20917.63
7.1.80.0100.26117.70
7.1.70.0150.23517.63
7.1.60.0230.23018.32
7.1.50.0260.19917.41
7.1.40.0230.19017.56
7.1.30.0290.20717.68
7.1.20.0230.20017.72
7.1.10.0130.24117.84
7.1.00.0130.25620.17
7.0.330.0230.18017.41
7.0.320.0260.28117.16
7.0.310.0290.17417.35
7.0.300.0200.17917.44
7.0.290.0170.19417.53
7.0.280.0070.15917.33
7.0.270.0170.17917.24
7.0.260.0270.21517.24
7.0.250.0200.21517.24
7.0.240.0200.22117.22
7.0.230.0130.19417.44
7.0.220.0070.19717.46
7.0.210.0270.27217.36
7.0.200.0130.24317.06
7.0.190.0230.24717.36
7.0.180.0130.18417.36
7.0.170.0140.16217.64
7.0.160.0100.25117.27
7.0.150.0170.25617.34
7.0.140.0080.25819.77
7.0.130.0100.20917.23
7.0.120.0230.27517.44
7.0.110.0200.28517.38
7.0.100.0070.22117.43
7.0.90.0130.24417.36
7.0.80.0230.21118.74
7.0.70.0350.26218.68
7.0.60.0350.23918.82
7.0.50.0280.24719.04
7.0.40.0030.22517.85
7.0.30.0180.24417.84
7.0.20.0120.19017.79
7.0.10.0150.25417.76
7.0.00.0130.25517.87
5.6.400.0100.25616.31
5.6.390.0100.21016.36
5.6.380.0130.29116.45
5.6.370.0170.21916.16
5.6.360.0170.25216.40
5.6.350.0070.24316.40
5.6.340.0130.17616.28
5.6.330.0130.16216.42
5.6.320.0200.27916.16
5.6.310.0500.22316.36
5.6.300.0030.18916.52
5.6.290.0230.25816.32
5.6.280.0100.32518.89
5.6.270.0230.23616.44
5.6.260.0130.27816.43
5.6.250.0070.22916.45
5.6.240.0230.21516.13
5.6.230.0170.24418.63
5.6.220.0070.26218.54
5.6.210.0150.24518.58
5.6.200.0130.23518.76
5.6.190.0200.27618.71
5.6.180.0250.24218.85
5.6.170.0100.19218.83
5.6.160.0120.29618.68
5.6.150.0160.21818.81
5.6.140.0150.25618.71
5.6.130.0170.28318.81
5.6.120.0120.25418.90
5.6.110.0080.24718.72
5.6.100.0130.27118.74
5.6.90.0130.28618.84
5.6.80.0120.24218.39
5.6.70.0100.20518.41
5.6.60.0170.26418.40
5.6.50.0180.29918.39
5.6.40.0180.21318.43
5.6.30.0200.23318.46
5.6.20.0170.23518.36
5.6.10.0050.19718.40
5.6.00.0180.26018.32
5.5.380.0200.21216.14
5.5.370.0170.26118.37
5.5.360.0130.22118.57
5.5.350.0130.23718.46
5.5.340.0180.26218.86
5.5.330.0120.26218.67
5.5.320.0100.25718.52
5.5.310.0070.24118.58
5.5.300.0120.29818.73
5.5.290.0170.23018.81
5.5.280.0150.25318.58
5.5.270.0130.27518.67
5.5.260.0080.26418.67
5.5.250.0100.26818.52
5.5.240.0130.23718.44
5.5.230.0080.23318.47
5.5.220.0130.21918.20
5.5.210.0430.25218.26
5.5.200.0150.28718.41
5.5.190.0080.21818.31
5.5.180.0170.23318.30
5.5.170.0170.25016.42
5.5.160.0080.22018.45
5.5.150.0170.30118.49
5.5.140.0100.21218.25
5.5.130.0120.24418.14
5.5.120.0320.22718.23
5.5.110.0080.21518.32
5.5.100.0130.28018.08
5.5.90.0170.26518.09
5.5.80.0120.29518.18
5.5.70.0200.18318.22
5.5.60.0100.23118.31
5.5.50.0080.27918.16
5.5.40.0250.28418.27
5.5.30.0130.22018.17
5.5.20.0070.25718.30
5.5.10.0100.22818.24
5.5.00.0180.26618.26
5.4.450.0120.22916.46
5.4.440.0120.20916.23
5.4.430.0080.22916.32
5.4.420.0130.21016.40
5.4.410.0130.22316.30
5.4.400.0080.26716.17
5.4.390.0150.22716.10
5.4.380.0120.23416.06
5.4.370.0170.27616.18
5.4.360.0130.28516.17
5.4.350.0100.23216.07
5.4.340.0150.21716.25
5.4.330.0200.21313.14
5.4.320.0080.25316.11
5.4.310.0130.27816.24
5.4.300.0050.22316.03
5.4.290.0120.26416.18
5.4.280.0180.25016.07
5.4.270.0220.27216.28
5.4.260.0170.26716.06
5.4.250.0080.20816.19
5.4.240.0100.24615.99
5.4.230.0070.24316.20
5.4.220.0070.24116.15
5.4.210.0170.25316.07
5.4.200.0170.22516.22
5.4.190.0070.24116.19
5.4.180.0170.29516.29
5.4.170.0130.25116.02
5.4.160.0080.23116.08
5.4.150.0150.22116.03
5.4.140.0150.23614.89
5.4.130.0080.25014.76
5.4.120.0120.27414.76
5.4.110.0130.26514.69
5.4.100.0100.29414.98
5.4.90.0120.25214.82
5.4.80.0100.21714.78
5.4.70.0050.26614.78
5.4.60.0180.26014.80
5.4.50.0200.24614.65
5.4.40.0150.26814.78
5.4.30.0120.25314.79
5.4.20.0150.23014.82
5.4.10.0030.21614.84
5.4.00.0170.22314.49
5.3.290.0170.29914.09
5.3.280.0050.26414.02
5.3.270.0100.30514.12
5.3.260.0180.29014.10
5.3.250.0130.26813.99
5.3.240.0180.27114.03
5.3.230.0100.26214.09
5.3.220.0220.29113.97
5.3.210.0200.27014.06
5.3.200.0080.25013.88
5.3.190.0130.27614.01
5.3.180.0130.28914.13
5.3.170.0080.27214.18
5.3.160.0070.27714.02
5.3.150.0150.27414.12
5.3.140.0170.25714.07
5.3.130.0100.26214.04
5.3.120.0130.25314.02
5.3.110.0050.30114.15
5.3.100.0080.22713.87
5.3.90.0150.24413.71
5.3.80.0180.26313.73
5.3.70.0130.24213.70
5.3.60.0220.23813.64
5.3.50.0250.28713.74
5.3.40.0200.21413.63
5.3.30.0070.26513.74
5.3.20.0170.25213.66
5.3.10.0030.27413.46
5.3.00.0180.24813.40
5.2.170.0000.20712.12
5.2.160.0070.27712.12
5.2.150.0270.21712.12
5.2.140.0070.22012.12
5.2.130.0070.24012.12
5.2.120.0170.23012.12
5.2.110.0030.28012.12
5.2.100.0100.28012.12
5.2.90.0100.26012.12
5.2.80.0070.28312.12
5.2.70.0100.29012.12
5.2.60.0130.28312.12
5.2.50.0170.30712.12
5.2.40.0170.29012.12
5.2.30.0170.22012.12
5.2.20.0070.27312.12
5.2.10.0170.22712.12
5.2.00.0100.28012.12
5.1.60.0100.25312.12
5.1.50.0100.28712.12
5.1.40.0100.23312.12
5.1.30.0170.25712.12
5.1.20.0130.27012.12
5.1.10.0070.23312.12
5.1.00.0100.28012.12
5.0.50.0070.04312.12
5.0.40.0030.03012.12
5.0.30.0030.05312.12
5.0.20.0000.02312.12
5.0.10.0070.04012.12
5.0.00.0000.04012.12
4.4.90.0030.02312.12
4.4.80.0000.02012.12
4.4.70.0000.01712.12
4.4.60.0000.02012.12
4.4.50.0030.03012.12
4.4.40.0000.02712.12
4.4.30.0000.03312.12
4.4.20.0000.03312.12
4.4.10.0000.02712.12
4.4.00.0130.04012.12
4.3.110.0030.03712.12
4.3.100.0000.01712.12
4.3.90.0030.02712.12
4.3.80.0030.04712.12
4.3.70.0030.03712.12
4.3.60.0070.02712.12
4.3.50.0030.03312.12
4.3.40.0000.05312.12
4.3.30.0000.04012.12
4.3.20.0000.03712.12
4.3.10.0000.03712.12
4.3.00.0000.02712.12

preferences:
81.7 ms | 401 KiB | 5 Q