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); 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.0110.00716.98
8.3.50.0140.00522.98
8.3.40.0090.00618.79
8.3.30.0070.00719.35
8.3.20.0190.00020.45
8.3.10.0040.00423.91
8.3.00.0030.00517.63
8.2.180.0060.01216.75
8.2.170.0100.01022.96
8.2.160.0140.00020.69
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.34
8.2.110.0100.00019.52
8.2.100.0090.00318.03
8.2.90.0030.00619.34
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0040.00418.05
8.2.50.0030.00618.07
8.2.40.0000.00818.34
8.2.30.0040.00418.38
8.2.20.0000.00817.92
8.2.10.0040.00418.23
8.2.00.0040.00417.85
8.1.280.0070.00725.92
8.1.270.0060.00324.08
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00321.12
8.1.230.0060.00617.70
8.1.220.0040.00417.80
8.1.210.0000.00918.77
8.1.200.0000.00817.48
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0000.01018.82
8.1.160.0000.00722.22
8.1.150.0030.00519.03
8.1.140.0070.00017.67
8.1.130.0000.00717.89
8.1.120.0000.00717.77
8.1.110.0030.00517.69
8.1.100.0040.00317.70
8.1.90.0030.00317.71
8.1.80.0030.00517.70
8.1.70.0030.00317.58
8.1.60.0050.00317.78
8.1.50.0080.00017.75
8.1.40.0030.00517.63
8.1.30.0030.00517.70
8.1.20.0050.00317.73
8.1.10.0070.00017.86
8.1.00.0030.00617.72
8.0.300.0000.00718.77
8.0.290.0040.00417.00
8.0.280.0030.00318.74
8.0.270.0030.00317.48
8.0.260.0030.00317.46
8.0.250.0050.00217.27
8.0.240.0000.00717.11
8.0.230.0000.00817.13
8.0.220.0000.00717.13
8.0.210.0000.01017.14
8.0.200.0030.00317.14
8.0.190.0040.00417.14
8.0.180.0040.00417.17
8.0.170.0080.00017.04
8.0.160.0000.00717.04
8.0.150.0070.00017.00
8.0.140.0070.00317.00
8.0.130.0050.00313.46
8.0.120.0040.00416.96
8.0.110.0040.00417.03
8.0.100.0050.00317.16
8.0.90.0000.00816.99
8.0.80.0060.00916.99
8.0.70.0040.00416.93
8.0.60.0040.00417.00
8.0.50.0040.00416.95
8.0.30.0130.01017.12
8.0.20.0060.01317.48
8.0.10.0000.00817.24
8.0.00.0100.00817.10
7.4.330.0000.00515.36
7.4.320.0030.00316.65
7.4.300.0070.00016.84
7.4.290.0070.00416.85
7.4.280.0080.00016.79
7.4.270.0050.00216.84
7.4.260.0030.00316.73
7.4.250.0050.00216.79
7.4.240.0000.00716.76
7.4.230.0030.00316.56
7.4.220.0210.00416.77
7.4.210.0100.00716.58
7.4.200.0040.00416.84
7.4.160.0130.00416.60
7.4.150.0110.00717.40
7.4.140.0110.00917.86
7.4.130.0070.00916.71
7.4.120.0120.00616.71
7.4.110.0090.00916.76
7.4.100.0170.00016.76
7.4.90.0140.00316.68
7.4.80.0150.00619.39
7.4.70.0090.00916.58
7.4.60.0120.00616.54
7.4.50.0000.00416.77
7.4.40.0030.01316.51
7.4.30.0030.01316.81
7.4.00.0130.00015.30
7.3.330.0060.00013.35
7.3.320.0030.00313.45
7.3.310.0000.00716.28
7.3.300.0030.00316.40
7.3.290.0030.01216.45
7.3.280.0090.00816.47
7.3.270.0000.01717.40
7.3.260.0140.00616.54
7.3.250.0140.00316.61
7.3.240.0060.01216.47
7.3.230.0080.00816.55
7.3.210.0060.01116.56
7.3.200.0140.00519.39
7.3.190.0120.00616.48
7.3.180.0230.00016.68
7.3.170.0120.00916.35
7.3.160.0060.01216.56
7.3.10.0150.00316.15
7.3.00.0160.00416.03
7.2.330.0150.00816.86
7.2.320.0130.00916.93
7.2.310.0080.00816.86
7.2.300.0060.01216.91
7.2.290.0100.00616.80
7.2.130.0090.00616.55
7.2.120.0130.00616.16
7.2.110.0120.00016.70
7.2.100.0080.01116.74
7.2.90.0140.01016.87
7.2.80.0040.01116.87
7.2.70.0210.01216.75
7.2.60.0080.02016.56
7.2.50.0040.01716.52
7.2.40.0150.00816.77
7.2.30.0110.01116.45
7.2.20.0060.00916.62
7.2.10.0100.00016.27
7.2.00.0050.00818.04
7.1.250.0070.01015.51
7.1.100.0080.00517.91
7.1.70.0000.00817.14
7.1.60.0190.00619.40
7.1.50.0000.02417.06
7.1.00.0030.07722.52
7.0.200.0040.00816.63
7.0.140.0030.07322.27
7.0.60.0000.04320.01
7.0.50.0170.04317.95
7.0.40.0100.09020.22
7.0.30.0570.06320.34
7.0.20.0430.04320.20
7.0.10.0100.06320.32
7.0.00.0100.08720.30
5.6.280.0000.07721.06
5.6.210.0100.08320.74
5.6.200.0070.04018.37
5.6.190.0030.04320.78
5.6.180.0300.08020.55
5.6.170.0330.07020.62
5.6.160.0070.07720.58
5.6.150.0070.08018.29
5.6.140.0130.06718.38
5.6.130.0100.06718.26
5.6.120.0070.06021.20
5.6.110.0200.07321.03
5.6.100.0100.06321.00
5.6.90.0030.05321.02
5.6.80.0170.03720.57
5.5.350.0300.07720.55
5.5.340.0070.08018.21
5.5.330.0000.07320.61
5.5.320.0370.07720.45
5.5.310.0270.05020.49
5.5.300.0130.07318.13
5.5.290.0030.07018.21
5.5.280.0000.04320.95
5.5.270.0070.08720.94
5.5.260.0070.08721.07
5.5.250.0100.07720.73
5.5.240.0230.07020.28
5.4.450.0300.04719.50
5.4.440.0370.04319.70
5.4.430.0230.04719.49
5.4.420.0370.03019.66
5.4.410.0230.04019.24
5.4.400.0300.04319.14
5.4.390.0430.03719.08
5.4.380.0370.06318.82
5.4.370.0470.05018.84
5.4.360.0370.05318.60
5.4.350.0370.06718.55
5.4.340.0330.05318.55
5.4.320.0080.03812.64
5.4.310.0110.03312.63
5.4.300.0080.04112.64
5.4.290.0060.03712.64
5.4.280.0080.03312.54
5.4.270.0080.03312.54
5.4.260.0040.03812.54
5.4.250.0120.03512.54
5.4.240.0090.03312.54
5.4.230.0110.04012.53
5.4.220.0050.03712.53
5.4.210.0040.03812.53
5.4.200.0050.03912.53
5.4.190.0090.04112.52
5.4.180.0110.03612.52
5.4.170.0110.03512.53
5.4.160.0040.03812.53
5.4.150.0120.04112.53
5.4.140.0090.04512.21
5.4.130.0050.04412.20
5.4.120.0050.04312.16
5.4.110.0040.03712.15
5.4.100.0090.03912.16
5.4.90.0120.03612.16
5.4.80.0070.03712.15
5.4.70.0060.04212.15
5.4.60.0070.03912.15
5.4.50.0070.03412.15
5.4.40.0080.03912.14
5.4.30.0080.03412.13
5.4.20.0070.03912.13
5.4.10.0070.03712.13
5.4.00.0050.03511.63
5.3.290.0060.04612.89
5.3.280.0070.04612.83
5.3.270.0090.04012.84
5.3.260.0090.04412.84
5.3.250.0080.03512.84
5.3.240.0110.03112.84
5.3.230.0060.03712.84
5.3.220.0050.03712.80
5.3.210.0060.03912.80
5.3.200.0060.03712.80
5.3.190.0080.04412.80
5.3.180.0060.04012.80
5.3.170.0140.03312.80
5.3.160.0060.04012.80
5.3.150.0090.04212.80
5.3.140.0080.03812.79
5.3.130.0080.04112.79
5.3.120.0060.04212.79
5.3.110.0100.04812.78
5.3.100.0050.04112.26
5.3.90.0080.04012.25
5.3.80.0060.03812.24
5.3.70.0060.04012.24
5.3.60.0050.03912.22
5.3.50.0090.03612.18
5.3.40.0090.03412.17
5.3.30.0070.03412.13
5.3.20.0070.03411.92
5.3.10.0070.03311.88
5.3.00.0040.03711.86
5.2.170.0080.0339.37
5.2.160.0060.0369.37
5.2.150.0080.0359.37
5.2.140.0040.0369.36
5.2.130.0100.0299.32
5.2.120.0070.0289.33
5.2.110.0070.0279.33
5.2.100.0040.0359.33
5.2.90.0090.0269.33
5.2.80.0020.0339.32
5.2.70.0050.0309.32
5.2.60.0070.0389.28
5.2.50.0080.0299.24
5.2.40.0040.0359.23
5.2.30.0110.0279.20
5.2.20.0050.0289.18
5.2.10.0090.0319.09
5.2.00.0060.0288.95
5.1.60.0040.0258.24
5.1.50.0040.0258.23
5.1.40.0060.0298.21
5.1.30.0060.0278.57
5.1.20.0040.0278.58
5.1.10.0020.0288.30
5.1.00.0060.0238.29
5.0.50.0030.0216.77
5.0.40.0040.0216.63
5.0.30.0020.0346.45
5.0.20.0040.0256.42
5.0.10.0050.0266.39
5.0.00.0060.0316.39
4.4.90.0030.0224.78
4.4.80.0030.0164.75
4.4.70.0040.0164.75
4.4.60.0050.0144.75
4.4.50.0020.0164.77
4.4.40.0040.0244.70
4.4.30.0020.0164.76
4.4.20.0030.0154.84
4.4.10.0040.0144.85
4.4.00.0050.0304.75
4.3.110.0070.0164.67
4.3.100.0040.0144.67
4.3.90.0050.0174.64
4.3.80.0030.0254.59
4.3.70.0030.0174.63
4.3.60.0070.0194.63
4.3.50.0030.0154.63
4.3.40.0060.0214.54
4.3.30.0020.0173.30
4.3.20.0040.0153.28
4.3.10.0020.0193.23
4.3.00.0000.01315.97

preferences:
45.2 ms | 401 KiB | 5 Q