3v4l.org

run code in 300+ PHP versions simultaneously
<?php class XML { public function __CONSTRUCT($array) { foreach($array as $key => $val) { if(isset($key) && $key) { $this->$key = (object) null; $this->$val = $val->bindTo($this->$key); } else { $this->$val = (object) null; $this->$val = $val->bindTo($this->$val, $this->$val); } } } } $array = ["database"=>["host"=>"localhost","dbname"=>"mydb","user"=>"root","password"=>""]]; $xml = new XML($array); echo($xml->{"database"}->{"host"});

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.0000.01416.50
8.3.50.0150.00417.93
8.3.40.0140.00318.80
8.3.30.0110.00418.87
8.3.20.0040.00420.20
8.3.10.0000.00823.45
8.3.00.0080.00019.26
8.2.180.0090.00618.29
8.2.170.0030.01022.96
8.2.160.0120.00320.38
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00417.63
8.2.110.0100.00720.38
8.2.100.0060.00617.93
8.2.90.0040.00419.30
8.2.80.0000.00917.97
8.2.70.0080.00017.63
8.2.60.0120.00017.93
8.2.50.0080.00018.07
8.2.40.0000.00719.28
8.2.30.0000.00720.63
8.2.20.0040.00417.63
8.2.10.0040.00418.13
8.2.00.0020.00518.18
8.1.280.0090.00625.92
8.1.270.0050.00323.91
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00622.47
8.1.230.0040.00817.64
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0080.00017.35
8.1.180.0090.00018.10
8.1.170.0040.00418.71
8.1.160.0000.00722.07
8.1.150.0000.00818.95
8.1.140.0040.00419.58
8.1.130.0040.00417.75
8.1.120.0000.00817.49
8.1.110.0040.00417.34
8.1.100.0040.00417.52
8.1.90.0000.00717.37
8.1.80.0000.00717.45
8.1.70.0000.00817.41
8.1.60.0040.00417.55
8.1.50.0000.00817.51
8.1.40.0050.00317.41
8.1.30.0080.00017.65
8.1.20.0000.00717.67
8.1.10.0040.00417.59
8.1.00.0000.00917.53
8.0.300.0040.00418.77
8.0.290.0030.00316.88
8.0.280.0000.00718.43
8.0.270.0070.00017.27
8.0.260.0000.00617.23
8.0.250.0000.00717.02
8.0.240.0000.00616.89
8.0.230.0070.00017.06
8.0.220.0040.00416.92
8.0.210.0070.00016.89
8.0.200.0000.00716.99
8.0.190.0000.00717.03
8.0.180.0040.00416.97
8.0.170.0000.00916.88
8.0.160.0040.00416.91
8.0.150.0050.00316.79
8.0.140.0000.00716.96
8.0.130.0030.00313.46
8.0.120.0040.00416.82
8.0.110.0000.00716.86
8.0.100.0040.00416.91
8.0.90.0030.00316.86
8.0.80.0090.00617.00
8.0.70.0030.00516.79
8.0.60.0000.00716.89
8.0.50.0050.00316.98
8.0.30.0080.01117.18
8.0.20.0080.01117.40
8.0.10.0050.00317.20
8.0.00.0090.01016.86
7.4.330.0050.00015.08
7.4.320.0000.00616.52
7.4.300.0000.00616.51
7.4.290.0070.00016.46
7.4.280.0000.00816.36
7.4.270.0000.00716.58
7.4.260.0080.00016.48
7.4.250.0000.00716.50
7.4.240.0050.00316.45
7.4.230.0000.00716.70
7.4.220.0090.00916.71
7.4.210.0000.01516.50
7.4.200.0070.00016.30
7.4.160.0100.00716.68
7.4.150.0110.00817.40
7.4.140.0090.01617.86
7.4.130.0090.00916.56
7.4.120.0070.01016.64
7.4.110.0110.01816.44
7.4.100.0120.00616.59
7.4.90.0070.01516.60
7.4.80.0100.00719.39
7.4.70.0070.01016.62
7.4.60.0060.01016.49
7.4.50.0040.00416.38
7.4.40.0140.00516.79
7.4.30.0090.00916.59
7.4.00.0070.01014.84
7.3.330.0050.00013.42
7.3.320.0050.00013.29
7.3.310.0060.00016.24
7.3.300.0000.00716.29
7.3.290.0030.01016.43
7.3.280.0100.00616.44
7.3.270.0030.01417.40
7.3.260.0140.00316.67
7.3.250.0120.00816.50
7.3.240.0110.00816.41
7.3.230.0100.00716.39
7.3.210.0060.01116.47
7.3.200.0140.00316.71
7.3.190.0050.01116.50
7.3.180.0070.01116.64
7.3.170.0060.01016.56
7.3.160.0120.00316.57
7.2.330.0070.01016.57
7.2.320.0030.01316.51
7.2.310.0070.01016.53
7.2.300.0080.01216.78
7.2.290.0100.00616.38
7.2.60.0060.00916.75
7.2.00.0280.00618.70
7.1.200.0070.00715.68
7.1.100.0040.01218.01
7.1.70.0030.01317.13
7.1.60.0110.01419.43
7.1.50.0060.01316.93
7.1.00.0000.07722.48
7.0.200.0280.01014.89
7.0.60.0030.07719.87
7.0.50.0100.05717.83
7.0.40.0070.09020.40
7.0.30.0330.04720.12
7.0.20.0230.07320.16
7.0.10.0070.06720.33
7.0.00.0170.08020.22
5.6.280.0000.03321.12
5.6.210.0070.08320.71
5.6.200.0000.08318.13
5.6.190.0030.09320.61
5.6.180.0400.05020.47
5.6.170.0130.05020.47
5.6.160.0100.04720.47
5.6.150.0030.06718.18
5.6.140.0030.04318.18
5.6.130.0030.04018.21
5.6.120.0130.08020.99
5.6.110.0030.08721.04
5.6.100.0130.07720.98
5.6.90.0070.05720.99
5.6.80.0170.07320.36
5.5.350.0200.06720.45
5.5.340.0100.06318.08
5.5.330.0070.05020.27
5.5.320.0230.04020.36
5.5.310.0200.06020.41
5.5.300.0000.05718.08
5.5.290.0030.05317.98
5.5.280.0100.05020.69
5.5.270.0030.04020.96
5.5.260.0100.07720.84
5.5.250.0100.07020.61
5.5.240.0030.07020.13
5.4.450.0630.07319.32
5.4.440.0530.07319.50
5.4.430.0570.06319.26
5.4.420.0470.05319.33
5.4.410.0400.06019.00
5.4.400.0430.05318.93
5.4.390.0500.05318.80
5.4.380.0470.05319.22
5.4.370.0530.04719.01
5.4.360.0630.04319.19
5.4.350.0530.05719.19
5.4.340.0630.06719.20
5.4.320.0470.05719.06
5.4.310.0570.05319.18
5.4.300.0600.04319.27
5.4.290.0430.05719.05
5.4.280.0500.06019.01
5.4.270.0570.04719.16
5.4.260.0600.04019.06
5.4.250.0500.05018.92
5.4.240.0530.04719.21
5.4.230.0400.06019.03
5.4.220.0570.06319.19
5.4.210.0600.04718.80
5.4.200.0530.05319.01
5.4.190.0470.05719.18
5.4.180.0500.05718.93
5.4.170.0600.04718.79
5.4.160.0530.05019.06
5.4.150.0600.05318.92
5.4.140.0370.06316.68
5.4.130.0530.04316.29
5.4.120.0470.05016.34
5.4.110.0870.05316.57
5.4.100.0700.05016.59
5.4.90.0730.03316.54
5.4.80.0670.04316.55
5.4.70.0630.05316.47
5.4.60.0530.05016.57
5.4.50.0600.05016.14
5.4.40.0630.05316.35
5.4.30.0530.05016.40
5.4.20.0700.04716.36
5.4.10.0670.07016.54
5.4.00.0570.05015.84

preferences:
32.69 ms | 400 KiB | 5 Q