3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Checks if a XML file's structure is valid. * @author Julius Beckmann <php@h4cc.de> * @param $file string * @return bool */ function isXmlStructureValid($file) { $prev = libxml_use_internal_errors(true); $ret = true; try { new SimpleXMLElement($file, 0, true); } catch(Exception $e) { $ret = false; } if(count(libxml_get_errors()) > 0) { // There has been XML errors $ret = false; } // Tidy up. libxml_clear_errors(); libxml_use_internal_errors($prev); return $ret; } $xml = '<html> <head><title>411 Length Required</title></head> <body bgcolor="white"> <center><h1>411 Length Required</h1></center> <hr><center>nginx</center> </body> </html>'; var_dump(isXmlStructureValid($xml));

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.0110.01118.55
8.3.50.0070.01021.20
8.3.40.0040.01118.92
8.3.30.0090.00618.58
8.3.20.0040.00419.02
8.3.10.0080.00021.35
8.3.00.0070.00021.85
8.2.180.0100.01318.54
8.2.170.0060.01518.91
8.2.160.0000.01422.96
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0040.00421.16
8.2.110.0040.01820.50
8.2.100.0050.00517.91
8.2.90.0080.00019.08
8.2.80.0030.00717.97
8.2.70.0030.00517.48
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0060.00317.97
8.2.30.0000.00821.36
8.2.20.0000.00817.72
8.2.10.0080.00017.83
8.2.00.0040.00418.02
8.1.280.0060.01225.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00722.59
8.1.230.0120.00021.18
8.1.220.0040.00418.77
8.1.210.0000.00818.96
8.1.200.0090.00017.38
8.1.190.0000.00917.66
8.1.180.0000.00818.10
8.1.170.0030.00518.66
8.1.160.0000.00718.93
8.1.150.0060.00318.69
8.1.140.0000.00817.47
8.1.130.0040.00417.96
8.1.120.0050.00217.38
8.1.110.0060.00317.40
8.1.100.0040.00417.38
8.1.90.0040.00417.38
8.1.80.0030.00617.38
8.1.70.0030.00317.47
8.1.60.0030.00517.67
8.1.50.0040.00417.55
8.1.40.0080.00017.43
8.1.30.0080.00017.56
8.1.20.0040.00417.57
8.1.10.0000.00817.73
8.1.00.0080.00017.38
8.0.300.0070.00019.85
8.0.290.0040.00417.16
8.0.280.0040.00418.39
8.0.270.0040.00416.99
8.0.260.0000.00716.90
8.0.250.0040.00417.06
8.0.240.0030.00617.04
8.0.230.0000.00717.02
8.0.220.0030.00316.98
8.0.210.0090.00016.96
8.0.200.0000.00617.07
8.0.190.0040.00417.12
8.0.180.0040.00416.88
8.0.170.0080.00017.11
8.0.160.0000.00717.00
8.0.150.0000.00816.80
8.0.140.0030.00616.99
8.0.130.0030.00513.49
8.0.120.0040.00417.00
8.0.110.0000.00716.91
8.0.100.0080.00016.77
8.0.90.0060.00316.99
8.0.80.0160.00016.99
8.0.70.0040.00416.86
8.0.60.0050.00216.79
8.0.50.0040.00416.86
8.0.30.0050.01717.01
8.0.20.0070.01217.40
8.0.10.0040.00417.25
8.0.00.0090.00916.69
7.4.330.0000.00516.85
7.4.320.0060.00016.42
7.4.300.0000.00616.47
7.4.290.0000.00716.74
7.4.280.0030.00716.53
7.4.270.0070.00016.52
7.4.260.0060.00013.42
7.4.250.0000.00716.48
7.4.240.0000.00716.74
7.4.230.0030.00316.66
7.4.220.0130.01116.57
7.4.210.0080.00816.68
7.4.200.0000.00716.61
7.4.190.0000.00716.69
7.4.160.0070.01016.64
7.4.150.0110.00717.40
7.4.140.0080.00817.86
7.4.130.0060.01416.54
7.4.120.0130.00316.71
7.4.110.0120.00616.50
7.4.100.0090.00916.50
7.4.90.0100.01616.49
7.4.80.0160.00319.39
7.4.70.0130.00616.42
7.4.60.0060.01016.57
7.4.50.0040.00416.48
7.4.40.0090.00922.77
7.4.30.0070.01716.56
7.4.00.0030.01115.16
7.3.330.0000.00513.25
7.3.320.0150.00013.07
7.3.310.0030.00316.38
7.3.300.0070.00016.38
7.3.290.0150.00016.30
7.3.280.0100.00716.39
7.3.270.0120.00617.40
7.3.260.0090.01218.24
7.3.250.0080.00916.46
7.3.240.0090.00916.59
7.3.230.0130.01016.39
7.3.210.0120.00616.51
7.3.200.0170.00719.39
7.3.190.0060.01216.39
7.3.180.0030.01316.59
7.3.170.0060.01216.61
7.3.160.0080.00816.45
7.3.120.0030.01414.96
7.2.330.0100.01016.55
7.2.320.0130.01016.70
7.2.310.0040.01816.83
7.2.300.0030.01316.78
7.2.290.0070.01516.71
7.2.00.0030.00919.50
7.1.100.0060.00617.89
7.1.70.0030.00717.16
7.1.60.0070.00417.28
7.1.50.0040.01916.79
7.1.00.0000.03722.36
7.0.200.0030.00616.69
7.0.140.0170.06322.11
7.0.90.0000.04319.97
7.0.80.0070.03720.06
7.0.70.0200.05019.92
7.0.60.0170.03719.95
7.0.50.0070.03020.32
7.0.40.0030.05020.11
7.0.30.0070.06720.07
7.0.20.0030.04720.09
7.0.10.0070.04320.20
7.0.00.0070.07720.04
5.6.280.0030.07321.13
5.6.230.0000.05320.71
5.6.220.0100.03320.72
5.6.210.0000.04020.80
5.6.200.0000.04020.99
5.6.190.0070.07721.01
5.6.180.0100.06321.05
5.6.170.0100.04721.05
5.6.160.0070.08321.13
5.6.150.0100.07021.13
5.6.140.0200.07021.11
5.6.130.0070.07721.01
5.6.120.0070.07021.13
5.6.110.0070.04721.07
5.6.100.0170.08021.08
5.6.90.0030.04321.06
5.6.80.0030.07720.60
5.6.70.0030.06720.48
5.6.60.0100.07320.41
5.6.50.0030.08320.39
5.6.40.0000.06020.57
5.6.30.0000.06020.49
5.6.20.0070.03720.36
5.6.10.0030.06320.36
5.6.00.0070.05020.46
5.5.370.0070.03020.57
5.5.360.0030.04020.53
5.5.350.0000.04720.42
5.5.340.0100.03320.86
5.5.330.0070.04020.92
5.5.320.0030.08720.69
5.5.310.0070.03720.92
5.5.300.0100.05320.87
5.5.290.0100.06720.88
5.5.280.0000.05720.96
5.5.270.0130.07720.79
5.5.260.0000.04720.87
5.5.250.0100.03320.73
5.5.240.0030.05020.26
5.5.230.0130.05320.32
5.5.220.0000.06720.18
5.5.210.0070.04020.28
5.5.200.0100.05020.23
5.5.190.0070.04320.15
5.5.180.0070.05320.13
5.5.160.0070.07720.31
5.5.150.0000.04020.15
5.5.140.0000.05020.23
5.5.130.0000.07320.29
5.5.120.0000.07320.30
5.5.110.0100.07320.21
5.5.100.0070.07720.16
5.5.90.0130.03020.11
5.5.80.0070.03720.12
5.5.70.0100.03320.04
5.5.60.0000.04020.00
5.5.50.0000.04320.19
5.5.40.0070.06320.10
5.5.30.0030.07320.10
5.5.20.0070.07020.00
5.5.10.0100.06020.05
5.5.00.0030.04020.11
5.4.450.0030.06719.53
5.4.440.0070.08019.44
5.4.430.0100.03719.42
5.4.420.0070.05019.41
5.4.410.0000.04019.16
5.4.400.0030.06319.03
5.4.390.0100.06019.21
5.4.380.0070.06318.98
5.4.370.0070.03319.11
5.4.360.0100.06019.07
5.4.350.0100.07019.02
5.4.340.0030.04019.30
5.4.320.0100.06719.19
5.4.310.0100.07018.95
5.4.300.0030.06719.11
5.4.290.0070.04319.09
5.4.280.0000.06019.20
5.4.270.0070.09019.01
5.4.260.0070.07319.10
5.4.250.0030.04018.94
5.4.240.0070.03719.21
5.4.230.0030.03719.11
5.4.220.0070.07719.19
5.4.210.0030.03718.93
5.4.200.0070.07719.29
5.4.190.0070.04718.96
5.4.180.0070.05718.97
5.4.170.0000.04718.96
5.4.160.0100.03019.09
5.4.150.0100.07319.17
5.4.140.0000.07716.64
5.4.130.0030.04016.54
5.4.120.0030.06316.31
5.4.110.0000.06716.63
5.4.100.0170.06316.59
5.4.90.0030.07316.59
5.4.80.0030.03716.61
5.4.70.0130.04716.60
5.4.60.0000.03716.50
5.4.50.0070.05316.44
5.4.40.0100.04716.42
5.4.30.0030.07316.48
5.4.20.0070.06716.59
5.4.10.0070.06316.46
5.4.00.0000.03716.06
5.3.290.0130.07314.69
5.3.280.0030.08014.77
5.3.270.0130.06014.65
5.3.260.0070.05014.71
5.3.250.0070.03714.61
5.3.240.0000.07714.61
5.3.230.0100.07014.72
5.3.220.0130.06014.57
5.3.210.0070.07714.57
5.3.200.0070.04314.56
5.3.190.0070.03314.66
5.3.180.0100.04314.68
5.3.170.0130.02714.60
5.3.160.0070.07014.52
5.3.150.0000.07014.56
5.3.140.0030.03714.69
5.3.130.0000.04314.56
5.3.120.0030.07714.54
5.3.110.0030.07714.74
5.3.100.0000.07014.08
5.3.90.0070.03314.17
5.3.80.0030.03314.09
5.3.70.0070.05713.99
5.3.60.0070.05014.13
5.3.50.0030.03313.94
5.3.40.0100.05714.02
5.3.30.0000.05014.05
5.3.20.0100.05713.72
5.3.10.0030.06313.78
5.3.00.0100.06013.82
5.2.170.0030.06013.72
5.2.160.0000.04013.72
5.2.150.0100.05013.72
5.2.140.0070.05313.72
5.2.130.0000.03013.72
5.2.120.0130.04713.72
5.2.110.0070.05713.72
5.2.100.0030.03713.72
5.2.90.0030.03313.72
5.2.80.0000.06313.72
5.2.70.0030.02713.72
5.2.60.0070.05013.72
5.2.50.0000.03013.72
5.2.40.0030.02713.72
5.2.30.0000.03313.72
5.2.20.0000.03313.72
5.2.10.0030.06313.72
5.2.00.0030.02713.72
5.1.60.0100.04713.72
5.1.50.0100.05013.72
5.1.40.0000.02713.72
5.1.30.0000.05713.72
5.1.20.0100.03713.72
5.1.10.0000.02713.72
5.1.00.0030.05313.72
5.0.50.0000.02013.72
5.0.40.0030.03713.72
5.0.30.0030.06013.72
5.0.20.0000.04713.72
5.0.10.0000.02313.72
5.0.00.0030.05713.72
4.4.90.0000.03013.72
4.4.80.0030.03313.72
4.4.70.0000.01713.72
4.4.60.0000.01313.72
4.4.50.0000.02713.72
4.4.40.0070.04713.72
4.4.30.0000.03313.72
4.4.20.0000.01713.72
4.4.10.0030.03713.72
4.4.00.0070.01713.72
4.3.110.0030.03313.72
4.3.100.0000.02313.72
4.3.90.0000.02713.72
4.3.80.0000.02313.72
4.3.70.0030.03313.72
4.3.60.0000.03013.72
4.3.50.0070.03013.72
4.3.40.0000.04713.72
4.3.30.0000.02313.72
4.3.20.0000.02013.72
4.3.10.0000.02013.72
4.3.00.0000.02713.72

preferences:
56.5 ms | 401 KiB | 5 Q