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> <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.0150.00716.63
8.3.50.0090.00922.06
8.3.40.0120.00318.95
8.3.30.0080.00619.17
8.3.20.0000.00720.50
8.3.10.0080.00023.84
8.3.00.0070.00317.75
8.2.180.0110.00418.39
8.2.170.0100.01018.96
8.2.160.0150.00022.96
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0070.00022.33
8.2.110.0060.00322.38
8.2.100.0070.00717.84
8.2.90.0000.00819.23
8.2.80.0080.00018.03
8.2.70.0000.00917.75
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0040.00418.22
8.2.30.0060.00318.20
8.2.20.0000.00817.76
8.2.10.0040.00420.03
8.2.00.0070.00417.87
8.1.280.0150.00025.92
8.1.270.0030.00722.20
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0120.00423.92
8.1.230.0090.00319.09
8.1.220.0000.00817.78
8.1.210.0030.00618.77
8.1.200.0030.00617.36
8.1.190.0080.00017.65
8.1.180.0030.00518.10
8.1.170.0050.00318.68
8.1.160.0000.00722.04
8.1.150.0040.00418.66
8.1.140.0000.00817.54
8.1.130.0050.00217.88
8.1.120.0000.00817.56
8.1.110.0070.00017.37
8.1.100.0040.00417.37
8.1.90.0000.00717.51
8.1.80.0040.00417.59
8.1.70.0000.00717.52
8.1.60.0030.00617.67
8.1.50.0090.00017.65
8.1.40.0000.00717.61
8.1.30.0090.00017.49
8.1.20.0000.00917.74
8.1.10.0050.00317.52
8.1.00.0040.00417.42
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0030.00618.39
8.0.270.0000.00717.27
8.0.260.0000.00617.26
8.0.250.0030.00316.91
8.0.240.0040.00417.04
8.0.230.0000.00716.81
8.0.220.0080.00016.80
8.0.210.0000.00716.94
8.0.200.0030.00316.97
8.0.190.0080.00016.92
8.0.180.0000.00716.92
8.0.170.0070.00017.05
8.0.160.0030.00516.85
8.0.150.0000.00716.80
8.0.140.0040.00416.88
8.0.130.0050.00013.52
8.0.120.0030.00516.87
8.0.110.0020.00517.04
8.0.100.0050.00216.97
8.0.90.0000.00816.99
8.0.80.0070.01017.00
8.0.70.0040.00417.04
8.0.60.0000.00816.82
8.0.50.0020.00517.04
8.0.30.0090.00917.30
8.0.20.0100.00817.40
8.0.10.0030.00517.09
8.0.00.0120.00916.83
7.4.330.0030.00315.00
7.4.320.0030.00316.73
7.4.300.0050.00316.54
7.4.290.0030.00316.66
7.4.280.0030.00316.49
7.4.270.0070.00016.65
7.4.260.0080.00316.64
7.4.250.0070.00016.47
7.4.240.0020.00616.66
7.4.230.0070.00016.72
7.4.220.0090.00916.67
7.4.210.0070.01216.72
7.4.200.0000.00716.60
7.4.190.0040.00416.64
7.4.160.0100.00616.53
7.4.150.0140.01017.40
7.4.140.0150.00817.86
7.4.130.0080.00816.68
7.4.120.0050.01316.58
7.4.110.0090.00916.59
7.4.100.0170.00716.82
7.4.90.0110.00716.46
7.4.80.0110.00719.39
7.4.70.0060.00916.52
7.4.60.0060.01216.63
7.4.50.0000.00816.44
7.4.40.0000.01822.77
7.4.30.0030.01316.67
7.4.00.0060.00915.04
7.3.330.0000.00713.30
7.3.320.0000.00513.12
7.3.310.0040.00416.38
7.3.300.0070.00016.40
7.3.290.0090.00916.50
7.3.280.0090.00916.31
7.3.270.0120.00617.40
7.3.260.0120.00916.47
7.3.250.0100.00816.52
7.3.240.0060.01116.42
7.3.230.0130.00716.74
7.3.210.0060.01316.43
7.3.200.0090.00919.39
7.3.190.0060.01616.54
7.3.180.0130.00316.35
7.3.170.0090.00916.76
7.3.160.0030.01316.49
7.3.120.0050.01214.78
7.3.110.0060.00614.61
7.3.100.0100.00714.80
7.3.90.0110.00414.86
7.3.80.0130.00314.56
7.3.70.0070.00714.56
7.3.60.0090.00014.90
7.3.50.0000.01514.50
7.3.40.0100.00314.87
7.3.30.0070.01014.93
7.3.20.0030.01016.76
7.3.10.0030.01016.63
7.3.00.0070.00716.67
7.2.330.0060.01216.70
7.2.320.0060.01216.49
7.2.310.0110.00716.72
7.2.300.0110.00516.77
7.2.290.0060.01616.70
7.2.250.0030.01215.19
7.2.240.0070.01015.09
7.2.230.0040.01414.77
7.2.220.0090.00915.08
7.2.210.0030.01315.00
7.2.200.0120.00315.10
7.2.190.0030.00614.94
7.2.180.0100.00315.20
7.2.170.0070.00715.22
7.2.80.0070.00716.63
7.2.60.0070.00716.79
7.2.00.0060.00819.41
7.1.330.0070.00715.59
7.1.320.0070.00715.63
7.1.310.0040.01215.67
7.1.300.0040.00815.73
7.1.290.0070.00715.68
7.1.280.0070.00815.76
7.1.270.0060.00615.66
7.1.260.0090.00015.78
7.1.200.0040.00715.96
7.1.100.0000.00918.39
7.1.70.0070.00017.18
7.1.60.0030.01619.33
7.1.50.0070.01416.90
7.1.00.0030.07722.40
7.0.200.0000.00716.89
7.0.140.0000.07722.19
7.0.100.0100.08019.91
7.0.90.0200.07319.98
7.0.80.0070.08319.90
7.0.70.0130.07319.89
7.0.60.0070.06719.88
7.0.50.0100.08020.29
7.0.40.0070.05720.02
7.0.30.0030.09020.11
7.0.20.0100.08320.12
7.0.10.0070.08020.04
7.0.00.0130.08320.13
5.6.280.0070.07021.11
5.6.250.0070.08320.71
5.6.240.0000.08720.57
5.6.230.0170.07720.68
5.6.220.0100.07720.69
5.6.210.0070.08320.45
5.6.200.0070.08021.08
5.6.190.0100.08321.02
5.6.180.0130.03321.06
5.6.170.0100.07321.00
5.6.160.0170.06721.08
5.6.150.0100.06721.05
5.6.140.0100.08321.00
5.6.130.0000.08321.08
5.6.120.0070.07321.00
5.6.110.0130.07321.09
5.6.100.0100.04321.07
5.6.90.0100.07320.94
5.6.80.0100.07720.32
5.6.70.0100.04020.44
5.6.60.0000.05720.54
5.6.50.0100.07320.39
5.6.40.0200.06720.43
5.6.30.0070.06320.30
5.6.20.0100.07020.44
5.6.10.0070.08020.38
5.6.00.0170.07020.36
5.5.380.0170.06020.36
5.5.370.0070.04320.45
5.5.360.0030.08720.48
5.5.350.0100.08320.38
5.5.340.0070.08020.87
5.5.330.0030.09020.93
5.5.320.0130.07320.90
5.5.310.0100.08020.81
5.5.300.0100.06320.83
5.5.290.0030.08720.82
5.5.280.0130.07720.87
5.5.270.0000.09020.90
5.5.260.0200.06320.75
5.5.250.0030.07020.45
5.5.240.0100.08020.30
5.5.230.0130.07320.21
5.5.220.0100.07320.30
5.5.210.0170.07020.31
5.5.200.0100.06020.19
5.5.190.0100.04720.07
5.5.180.0100.07720.17
5.5.160.0070.07720.27
5.5.150.0100.07020.27
5.5.140.0070.08020.26
5.5.130.0030.08320.16
5.5.120.0030.05020.26
5.5.110.0070.07720.10
5.5.100.0100.07320.11
5.5.90.0100.07020.05
5.5.80.0030.08020.11
5.5.70.0070.08020.09
5.5.60.0100.07720.04
5.5.50.0070.08020.05
5.5.40.0130.06320.09
5.5.30.0130.06720.04
5.5.20.0070.07720.04
5.5.10.0130.06020.08
5.5.00.0030.08019.99
5.4.450.0130.07319.52
5.4.440.0100.05019.43
5.4.430.0100.07319.39
5.4.420.0070.07319.34
5.4.410.0030.08719.42
5.4.400.0100.07718.99
5.4.390.0030.07719.22
5.4.380.0100.05719.19
5.4.370.0070.07019.20
5.4.360.0100.07319.00
5.4.350.0070.07719.11
5.4.340.0070.07018.97
5.4.320.0100.04319.29
5.4.310.0000.05019.19
5.4.300.0200.03318.95
5.4.290.0100.07319.00
5.4.280.0200.06018.98
5.4.270.0130.07318.99
5.4.260.0030.08019.16
5.4.250.0030.07719.04
5.4.240.0000.08319.10
5.4.230.0030.08019.29
5.4.220.0070.08019.18
5.4.210.0030.07319.19
5.4.200.0100.04019.09
5.4.190.0070.07719.18
5.4.180.0070.03719.09
5.4.170.0070.07718.94
5.4.160.0130.03319.17
5.4.150.0030.04718.95
5.4.140.0070.07316.52
5.4.130.0030.05716.46
5.4.120.0070.07016.50
5.4.110.0070.07316.46
5.4.100.0070.08016.52
5.4.90.0070.05716.63
5.4.80.0130.06716.50
5.4.70.0100.06716.45
5.4.60.0000.07716.59
5.4.50.0030.08316.44
5.4.40.0130.06716.43
5.4.30.0100.05716.61
5.4.20.0130.06716.58
5.4.10.0100.04016.43
5.4.00.0030.07015.93
5.3.290.0100.07314.86
5.3.280.0100.07314.67
5.3.270.0100.07014.65
5.3.260.0070.07714.68
5.3.250.0130.06714.76
5.3.240.0100.07314.63
5.3.230.0030.08014.79
5.3.220.0070.04314.61
5.3.210.0130.05714.71
5.3.200.0000.04714.75
5.3.190.0130.06314.68
5.3.180.0070.06714.65
5.3.170.0100.07014.67
5.3.160.0100.04014.56
5.3.150.0070.08014.69
5.3.140.0130.06714.66
5.3.130.0030.06314.60
5.3.120.0030.06314.64
5.3.110.0030.07314.63
5.3.100.0130.07014.17
5.3.90.0130.06314.05
5.3.80.0030.05714.02
5.3.70.0030.04714.17
5.3.60.0100.06314.05
5.3.50.0030.07014.09
5.3.40.0030.08014.05
5.3.30.0070.07314.00
5.3.20.0130.07013.78
5.3.10.0030.07713.65
5.3.00.0070.07313.63
5.2.170.0030.06711.14
5.2.160.0200.05311.14
5.2.150.0030.04311.10
5.2.140.0070.06011.24
5.2.130.0030.05711.29
5.2.120.0100.04011.22
5.2.110.0030.03711.09
5.2.100.0070.05311.22
5.2.90.0070.05711.18
5.2.80.0100.04011.20
5.2.70.0070.05311.18
5.2.60.0100.05711.23
5.2.50.0030.03011.16
5.2.40.0030.03311.00
5.2.30.0070.06011.16
5.2.20.0100.05310.94
5.2.10.0070.04010.86
5.2.00.0000.05710.77
5.1.60.0100.05010.16
5.1.50.0030.02710.16
5.1.40.0130.0239.99
5.1.30.0030.03710.32
5.1.20.0030.05710.45
5.1.10.0100.04710.06
5.1.00.0070.05010.15
5.0.50.0000.0308.39
5.0.40.0030.0338.41
5.0.30.0070.0338.34
5.0.20.0030.0438.30
5.0.10.0100.0408.05
5.0.00.0100.0578.16
4.4.90.0000.0277.95
4.4.80.0000.0277.95
4.4.70.0000.0277.95
4.4.60.0030.0337.95
4.4.50.0100.0277.95
4.4.40.0000.0307.95
4.4.30.0000.0237.95
4.4.20.0000.0307.95
4.4.10.0070.0307.95
4.4.00.0030.0477.95
4.3.110.0070.0307.95
4.3.100.0070.0237.95
4.3.90.0000.0337.95
4.3.80.0100.0477.95
4.3.70.0000.0377.95
4.3.60.0000.0377.95
4.3.50.0070.0177.95
4.3.40.0000.0307.95
4.3.30.0030.0337.95
4.3.20.0000.0407.95
4.3.10.0030.0337.95
4.3.00.0000.0307.95

preferences:
27.94 ms | 401 KiB | 5 Q