3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement('<tag></tag>'); echo 'An empty SimpleXMLElement is '; var_export((bool) $xml); echo "\n"; $xml = new SimpleXMLElement('<tag>data</tag>'); echo 'A SimpleXMLElement with data is '; var_export((bool) $xml); echo "\n"; $obj = new stdClass(); echo 'An empty stdClass is '; var_export((bool) $obj); echo "\n"; class A { public function __toString() { return ''; } } $a = new A(); echo 'An class that returns an empty string from __toString() is '; var_export((bool) $a);

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.0120.00316.63
8.3.50.0140.00523.04
8.3.40.0070.01118.83
8.3.30.0140.00019.18
8.3.20.0120.00020.41
8.3.10.0040.00423.96
8.3.00.0040.00417.50
8.2.180.0060.00916.72
8.2.170.0170.00322.96
8.2.160.0070.00720.45
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0080.00021.24
8.2.110.0060.00322.48
8.2.100.0080.00417.97
8.2.90.0040.00419.43
8.2.80.0080.00017.97
8.2.70.0050.00517.63
8.2.60.0030.00518.16
8.2.50.0000.00818.07
8.2.40.0060.00318.41
8.2.30.0040.00418.29
8.2.20.0070.00317.80
8.2.10.0040.00418.14
8.2.00.0030.00517.86
8.1.280.0040.01125.92
8.1.270.0080.00023.96
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0030.00624.06
8.1.230.0110.00019.41
8.1.220.0050.00317.89
8.1.210.0040.00418.77
8.1.200.0050.00517.47
8.1.190.0040.00417.47
8.1.180.0040.00418.10
8.1.170.0070.00318.93
8.1.160.0070.00022.26
8.1.150.0040.00419.16
8.1.140.0000.00817.73
8.1.130.0040.00418.11
8.1.120.0070.00017.72
8.1.110.0000.00817.59
8.1.100.0070.00017.66
8.1.90.0070.00017.64
8.1.80.0070.00017.75
8.1.70.0030.00317.66
8.1.60.0000.00817.77
8.1.50.0040.00417.73
8.1.40.0070.00017.67
8.1.30.0040.00417.84
8.1.20.0040.00417.74
8.1.10.0000.00817.79
8.1.00.0000.00817.59
8.0.300.0000.00718.77
8.0.290.0050.00216.88
8.0.280.0030.00518.68
8.0.270.0050.00217.49
8.0.260.0000.00717.54
8.0.250.0000.00717.17
8.0.240.0000.00717.09
8.0.230.0030.00417.14
8.0.220.0030.00317.18
8.0.210.0040.00417.02
8.0.200.0000.00717.06
8.0.190.0030.00617.26
8.0.180.0000.00717.16
8.0.170.0030.00517.20
8.0.160.0000.00817.11
8.0.150.0070.00017.08
8.0.140.0070.00316.98
8.0.130.0060.00313.46
8.0.120.0030.00616.99
8.0.110.0000.00817.09
8.0.100.0000.00717.00
8.0.90.0070.00017.18
8.0.80.0120.00317.18
8.0.70.0000.00717.13
8.0.60.0000.00717.14
8.0.50.0000.00816.99
8.0.30.0160.00617.29
8.0.20.0110.01017.47
8.0.10.0000.00917.21
8.0.00.0090.00917.04
7.4.330.0000.00515.13
7.4.320.0000.00616.58
7.4.300.0000.00616.75
7.4.290.0090.00016.71
7.4.280.0070.00016.84
7.4.270.0000.00716.76
7.4.260.0050.00316.73
7.4.250.0050.00216.83
7.4.240.0020.00616.69
7.4.230.0000.00716.60
7.4.220.0060.01216.68
7.4.210.0110.00616.57
7.4.200.0000.00716.71
7.4.160.0130.00316.75
7.4.150.0090.00917.40
7.4.140.0090.00817.86
7.4.130.0120.00816.73
7.4.120.0100.01116.60
7.4.110.0040.01416.85
7.4.100.0100.00716.63
7.4.90.0110.00616.77
7.4.80.0060.01619.39
7.4.70.0080.00816.65
7.4.60.0110.00616.71
7.4.50.0000.00416.34
7.4.40.0060.01116.80
7.4.30.0150.00016.85
7.4.00.0060.00915.10
7.3.330.0000.00613.23
7.3.320.0000.00513.47
7.3.310.0070.00016.39
7.3.300.0000.00716.45
7.3.290.0090.00616.48
7.3.280.0070.00916.45
7.3.270.0060.01217.40
7.3.260.0090.00916.50
7.3.250.0110.00916.64
7.3.240.0080.01016.56
7.3.230.0100.00716.43
7.3.210.0070.01016.65
7.3.200.0120.01119.39
7.3.190.0170.00316.63
7.3.180.0130.00916.54
7.3.170.0100.01016.54
7.3.160.0090.01216.50
7.3.120.0070.01014.75
7.3.110.0070.01114.70
7.3.100.0160.00014.88
7.3.90.0030.01015.10
7.3.80.0070.00715.05
7.3.70.0040.01114.69
7.3.60.0130.00015.05
7.3.50.0040.01214.88
7.3.40.0090.00614.93
7.3.30.0070.00714.98
7.3.20.0120.00916.50
7.3.10.0110.00416.69
7.3.00.0100.01016.66
7.2.330.0110.01116.65
7.2.320.0140.01116.82
7.2.310.0110.00516.82
7.2.300.0200.00316.63
7.2.290.0100.00716.66
7.2.250.0070.01015.06
7.2.240.0060.01215.30
7.2.230.0060.01015.15
7.2.220.0070.00714.96
7.2.210.0060.00315.16
7.2.200.0060.00914.98
7.2.190.0000.01815.15
7.2.180.0000.01414.93
7.2.170.0090.00615.01
7.2.00.0000.01219.60
7.1.330.0030.01415.54
7.1.320.0120.00315.88
7.1.310.0040.00715.64
7.1.300.0000.01415.66
7.1.290.0080.00415.53
7.1.280.0000.01415.68
7.1.270.0090.00615.47
7.1.260.0090.00315.77
7.1.200.0100.00315.90
7.1.100.0040.01118.21
7.1.70.0040.00417.03
7.1.60.0060.01819.40
7.1.50.0150.00916.96
7.1.00.0000.07722.59
7.0.200.0080.00316.74
7.0.140.0100.06322.08
7.0.60.0030.08720.00
7.0.50.0070.07318.08
7.0.40.0130.08020.23
7.0.30.0170.04320.20
7.0.20.0400.07020.29
7.0.10.0030.04320.20
7.0.00.0030.04720.37
5.6.280.0070.07021.00
5.6.210.0000.04320.66
5.6.200.0070.06018.34
5.6.190.0030.05320.70
5.6.180.0170.04720.55
5.6.170.0300.07320.62
5.6.160.0000.05320.58
5.6.150.0030.04018.33
5.6.140.0000.08718.38
5.6.130.0200.06318.39
5.6.120.0170.02721.17
5.6.110.0070.04021.13
5.6.100.0030.08721.00
5.6.90.0030.06321.16
5.6.80.0170.05020.48
5.5.350.0330.07320.33
5.5.340.0030.04018.21
5.5.330.0100.05720.64
5.5.320.0200.04020.41
5.5.310.0330.06720.39
5.5.300.0030.09018.11
5.5.290.0100.07718.13
5.5.280.0130.08020.82
5.5.270.0070.06720.91
5.5.260.0130.06720.98
5.5.250.0070.08320.55
5.5.240.0270.06720.20
5.4.450.0170.04719.41
5.4.440.0300.05019.71
5.4.430.0530.04019.46
5.4.420.0130.04719.55
5.4.410.0070.04719.50
5.4.400.0300.04019.34
5.4.390.0330.05019.04
5.4.380.0270.05718.84
5.4.370.0370.05718.59
5.4.360.0200.06018.55
5.4.350.0300.06018.86
5.4.340.0470.04718.89
5.4.320.0050.03512.64
5.4.310.0040.03912.64
5.4.300.0070.03412.64
5.4.290.0060.03612.64
5.4.280.0070.03312.53
5.4.270.0050.03512.54
5.4.260.0060.03612.54
5.4.250.0040.03812.54
5.4.240.0060.03412.54
5.4.230.0130.03412.53
5.4.220.0070.04812.53
5.4.210.0050.03912.53
5.4.200.0060.04012.53
5.4.190.0040.03712.53
5.4.180.0090.03212.52
5.4.170.0040.03812.53
5.4.160.0080.03312.54
5.4.150.0040.03612.53
5.4.140.0070.03512.21
5.4.130.0050.03512.20
5.4.120.0060.03412.15
5.4.110.0060.03312.15
5.4.100.0030.03612.15
5.4.90.0050.04012.16
5.4.80.0050.03912.16
5.4.70.0060.03512.15
5.4.60.0070.03412.14
5.4.50.0090.03112.14
5.4.40.0030.03812.14
5.4.30.0030.03812.13
5.4.20.0080.03312.13
5.4.10.0060.03412.13
5.4.00.0070.03511.62
5.3.290.0070.03812.90
5.3.280.0020.04112.82
5.3.270.0040.04112.84
5.3.260.0070.03812.84
5.3.250.0060.03612.84
5.3.240.0090.03412.84
5.3.230.0080.03512.83
5.3.220.0070.03512.80
5.3.210.0070.03712.80
5.3.200.0100.03212.80
5.3.190.0040.03912.80
5.3.180.0070.03612.80
5.3.170.0020.04012.80
5.3.160.0070.03512.80
5.3.150.0060.03612.80
5.3.140.0070.03412.79
5.3.130.0060.03712.78
5.3.120.0050.03812.79
5.3.110.0040.04012.79
5.3.100.0090.03312.27
5.3.90.0060.03512.25
5.3.80.0050.04412.24
5.3.70.0110.03512.24
5.3.60.0060.04612.23
5.3.50.0070.04212.17
5.3.40.0030.03812.18
5.3.30.0050.03412.14
5.3.20.0060.03511.92
5.3.10.0040.03611.88
5.3.00.0040.03711.86
5.2.170.0050.0299.37
5.2.160.0040.0349.37
5.2.150.0080.0359.37
5.2.140.0090.0269.36
5.2.130.0090.0259.33
5.2.120.0040.0289.33
5.2.110.0030.0389.33
5.2.100.0050.0379.33
5.2.90.0050.0299.33
5.2.80.0070.0269.32
5.2.70.0040.0309.32
5.2.60.0050.0299.27
5.2.50.0050.0299.24
5.2.40.0050.0289.22
5.2.30.0030.0319.20
5.2.20.0020.0349.18
5.2.10.0030.0309.09
5.2.00.0050.0288.95
5.1.60.0020.0268.24
5.1.50.0070.0228.23
5.1.40.0040.0248.21
5.1.30.0050.0248.57
5.1.20.0060.0248.58
5.1.10.0040.0258.30
5.1.00.0050.0258.30
5.0.50.0050.0196.78
5.0.40.0060.0166.63
5.0.30.0040.0306.45
5.0.20.0040.0186.42
5.0.10.0040.0196.39
5.0.00.0030.0306.39
4.4.90.0030.0144.78
4.4.80.0030.0204.75
4.4.70.0040.0144.76
4.4.60.0040.0184.76
4.4.50.0050.0134.77
4.4.40.0020.0324.71
4.4.30.0040.0144.76
4.4.20.0020.0164.85
4.4.10.0030.0154.85
4.4.00.0020.0334.76
4.3.110.0030.0154.67
4.3.100.0030.0154.66
4.3.90.0040.0194.63
4.3.80.0050.0294.59
4.3.70.0040.0194.63
4.3.60.0070.0164.63
4.3.50.0020.0174.63
4.3.40.0030.0244.54
4.3.30.0020.0173.30
4.3.20.0030.0163.29
4.3.10.0000.0183.24
4.3.00.0130.01715.97

preferences:
68.48 ms | 401 KiB | 5 Q