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 'A class that returns an empty string from __toString() is '; var_export((string)(bool)(string) $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.0110.01118.32
8.3.50.0070.01222.97
8.3.40.0030.01418.82
8.3.30.0030.01619.34
8.3.20.0070.00020.46
8.3.10.0040.00423.73
8.3.00.0090.00017.63
8.2.180.0130.00316.88
8.2.170.0100.01022.96
8.2.160.0130.00320.64
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00421.10
8.2.110.0050.00522.25
8.2.100.0060.00618.28
8.2.90.0040.00419.48
8.2.80.0030.00617.97
8.2.70.0030.00617.88
8.2.60.0040.00418.05
8.2.50.0030.00618.07
8.2.40.0080.00018.36
8.2.30.0000.00718.38
8.2.20.0050.00317.95
8.2.10.0050.00218.26
8.2.00.0070.00018.02
8.1.280.0110.00725.92
8.1.270.0090.00024.10
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00624.04
8.1.230.0040.00719.27
8.1.220.0050.00317.91
8.1.210.0080.00018.77
8.1.200.0030.00617.48
8.1.190.0080.00017.60
8.1.180.0030.00618.10
8.1.170.0050.00318.76
8.1.160.0000.00722.18
8.1.150.0060.00319.12
8.1.140.0040.00417.52
8.1.130.0000.00818.16
8.1.120.0000.00717.67
8.1.110.0050.00217.59
8.1.100.0070.00017.73
8.1.90.0000.00717.70
8.1.80.0040.00417.73
8.1.70.0040.00417.57
8.1.60.0000.00917.76
8.1.50.0080.00017.71
8.1.40.0000.00817.77
8.1.30.0030.00617.91
8.1.20.0030.00617.80
8.1.10.0000.00717.80
8.1.00.0040.00417.66
8.0.300.0070.00018.77
8.0.290.0060.00316.75
8.0.280.0040.00418.70
8.0.270.0030.00317.32
8.0.260.0030.00317.49
8.0.250.0030.00317.15
8.0.240.0080.00017.09
8.0.230.0000.00717.20
8.0.220.0030.00317.16
8.0.210.0000.00817.02
8.0.200.0030.00317.10
8.0.190.0000.00717.24
8.0.180.0040.00417.01
8.0.170.0000.00817.10
8.0.160.0050.00217.12
8.0.150.0000.00817.04
8.0.140.0120.00017.01
8.0.130.0000.00613.49
8.0.120.0070.00017.06
8.0.110.0080.00017.02
8.0.100.0040.00416.92
8.0.90.0040.00416.98
8.0.80.0030.01316.96
8.0.70.0030.00517.17
8.0.60.0040.00417.02
8.0.50.0050.00217.16
8.0.30.0090.00917.29
8.0.20.0090.01217.50
8.0.10.0080.00017.07
8.0.00.0090.01116.95
7.4.330.0030.00315.24
7.4.320.0000.00616.81
7.4.300.0040.00416.84
7.4.290.0050.00216.77
7.4.280.0090.00016.67
7.4.270.0070.00016.67
7.4.260.0070.00316.76
7.4.250.0040.00416.83
7.4.240.0050.00316.75
7.4.230.0000.00716.94
7.4.220.0110.00716.81
7.4.210.0100.00316.89
7.4.200.0060.00316.91
7.4.160.0130.00716.68
7.4.150.0150.00917.40
7.4.140.0120.00617.86
7.4.130.0110.00816.73
7.4.120.0090.00816.75
7.4.110.0080.00816.80
7.4.100.0030.01416.58
7.4.90.0030.01616.69
7.4.80.0070.01019.39
7.4.70.0090.00916.35
7.4.60.0170.00016.79
7.4.50.0030.00416.86
7.4.40.0100.01316.61
7.4.30.0060.00916.79
7.4.00.0030.01015.19
7.3.330.0000.00513.32
7.3.320.0060.00013.25
7.3.310.0030.00316.50
7.3.300.0070.00016.45
7.3.290.0100.01016.45
7.3.280.0110.00716.52
7.3.270.0200.00617.40
7.3.260.0110.00616.82
7.3.250.0110.00816.85
7.3.240.0110.00716.57
7.3.230.0130.01316.53
7.3.210.0030.01316.58
7.3.200.0130.00319.39
7.3.190.0090.01316.84
7.3.180.0080.00816.39
7.3.170.0080.00816.57
7.3.160.0110.00716.54
7.2.330.0120.01216.89
7.2.320.0070.01116.70
7.2.310.0150.00316.85
7.2.300.0110.00716.86
7.2.290.0110.00916.86
7.2.00.0060.00619.26
7.1.100.0030.00618.08
7.1.70.0040.00417.00
7.1.60.0110.01419.40
7.1.50.0060.00617.02
7.1.00.0070.07322.51
7.0.200.0070.00716.73
7.0.140.0000.08022.09
7.0.60.0070.08020.19
7.0.50.0070.07318.04
7.0.40.0100.05720.20
7.0.30.0270.04720.32
7.0.20.0200.04320.31
7.0.10.0100.08720.23
7.0.00.0100.06020.22
5.6.280.0070.07021.18
5.6.210.0100.06320.66
5.6.200.0130.06718.23
5.6.190.0000.08320.85
5.6.180.2900.04720.64
5.6.170.0230.04020.60
5.6.160.0100.08720.79
5.6.150.0130.07318.38
5.6.140.0030.08318.22
5.6.130.0070.07718.31
5.6.120.0070.03721.21
5.6.110.0070.08321.18
5.6.100.0230.06721.04
5.6.90.0100.07721.20
5.6.80.0100.07320.54
5.5.350.0230.02720.64
5.5.340.0030.07718.04
5.5.330.0130.06320.29
5.5.320.0200.03720.38
5.5.310.0270.07020.47
5.5.300.0030.08718.12
5.5.290.0000.04318.11
5.5.280.0100.08320.76
5.5.270.0100.06321.00
5.5.260.0170.08020.85
5.5.250.0100.05020.70
5.5.240.0100.07020.24
5.4.450.0600.05719.56
5.4.440.0270.05319.74
5.4.430.0200.06019.78
5.4.420.0130.06019.69
5.4.410.0230.04018.77
5.4.400.0270.06718.75
5.4.390.0170.07018.84
5.4.380.0170.04318.84
5.4.370.0000.04318.75
5.4.360.0100.03318.79
5.4.350.0070.03512.15
5.4.340.0100.03412.15
5.4.320.0100.03212.64
5.4.310.0060.03712.64
5.4.300.0060.03612.64
5.4.290.0060.03912.63
5.4.280.0060.03612.53
5.4.270.0070.03612.53
5.4.260.0050.04612.54
5.4.250.0050.03812.53
5.4.240.0050.03612.54
5.4.230.0080.03712.52
5.4.220.0080.03912.53
5.4.210.0080.03812.53
5.4.200.0060.03812.52
5.4.190.0020.03912.52
5.4.180.0040.04212.52
5.4.170.0010.04012.54
5.4.160.0060.03512.54
5.4.150.0080.04112.52
5.4.140.0030.04112.21
5.4.130.0050.03512.20
5.4.120.0070.03312.16
5.4.110.0060.03412.15
5.4.100.0050.03812.15
5.4.90.0040.04012.15
5.4.80.0070.03512.15
5.4.70.0040.03712.15
5.4.60.0090.03112.15
5.4.50.0060.03412.14
5.4.40.0040.03612.13
5.4.30.0040.03612.13
5.4.20.0060.03412.13
5.4.10.0120.02812.13
5.4.00.0050.03611.62
5.3.290.0080.03712.90
5.3.280.0050.03812.82
5.3.270.0090.03512.84
5.3.260.0060.04012.84
5.3.250.0060.03612.84
5.3.240.0080.03612.84
5.3.230.0040.03912.84
5.3.220.0080.03412.80
5.3.210.0060.03912.80
5.3.200.0050.03712.80
5.3.190.0040.03912.80
5.3.180.0050.03712.80
5.3.170.0050.03712.80
5.3.160.0060.03612.80
5.3.150.0030.03912.80
5.3.140.0090.03712.79
5.3.130.0090.03712.79
5.3.120.0070.03812.79
5.3.110.0060.03912.79
5.3.100.0060.04512.27
5.3.90.0040.03812.25
5.3.80.0050.03812.24
5.3.70.0050.03712.24
5.3.60.0060.03712.22
5.3.50.0080.03412.17
5.3.40.0070.03612.18
5.3.30.0080.03312.14
5.3.20.0050.03711.92
5.3.10.0070.04311.88
5.3.00.0070.03411.86
5.2.170.0050.0309.37
5.2.160.0050.0309.37
5.2.150.0060.0299.36
5.2.140.0050.0309.36
5.2.130.0040.0309.32
5.2.120.0020.0319.32
5.2.110.0050.0299.34
5.2.100.0040.0299.33
5.2.90.0050.0289.32
5.2.80.0040.0319.32
5.2.70.0050.0329.32
5.2.60.0040.0309.27
5.2.50.0050.0349.24
5.2.40.0060.0319.22
5.2.30.0040.0309.20
5.2.20.0060.0299.18
5.2.10.0060.0309.09
5.2.00.0040.0318.95
5.1.60.0030.0268.24
5.1.50.0010.0288.23
5.1.40.0020.0268.22
5.1.30.0020.0278.57
5.1.20.0020.0298.58
5.1.10.0040.0268.29
5.1.00.0060.0248.29
5.0.50.0060.0186.77
5.0.40.0030.0206.63
5.0.30.0020.0396.45
5.0.20.0050.0216.42
5.0.10.0030.0206.40
5.0.00.0040.0306.39
4.4.90.0030.0154.78
4.4.80.0010.0174.76
4.4.70.0040.0134.75
4.4.60.0020.0164.76
4.4.50.0040.0144.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0010.0174.84
4.4.10.0030.0154.85
4.4.00.0030.0244.76
4.3.110.0020.0204.67
4.3.100.0060.0184.67
4.3.90.0030.0134.64
4.3.80.0040.0234.59
4.3.70.0030.0144.63
4.3.60.0030.0144.63
4.3.50.0040.0144.63
4.3.40.0010.0254.54
4.3.30.0010.0193.30
4.3.20.0020.0153.28
4.3.10.0020.0153.24
4.3.00.0070.0237.29

preferences:
37.4 ms | 401 KiB | 5 Q