3v4l.org

run code in 300+ PHP versions simultaneously
<?php $object = new stdClass(); $object->{'1'} = 'one'; $array = (array) $object; var_dump($array); /* produces array(1) { ["1"]=> string(3) "one" } */ //none of the following will work $key = '1'; echo $array[1], $array['1'], $array["1"], $array[(string)1], $array[$key];

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.0170.00316.63
8.3.50.0150.00722.03
8.3.40.0140.00018.84
8.3.30.0070.00718.83
8.3.20.0080.00020.04
8.3.10.0080.00023.47
8.3.00.0040.00419.38
8.2.180.0000.01416.50
8.2.170.0110.01122.96
8.2.160.0070.01019.25
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00417.50
8.2.120.0040.00426.35
8.2.110.0100.00019.29
8.2.100.0070.00418.03
8.2.90.0000.00817.93
8.2.80.0040.00418.04
8.2.70.0030.00518.03
8.2.60.0050.00318.03
8.2.50.0080.00618.10
8.2.40.0040.00420.57
8.2.30.0070.00020.61
8.2.20.0050.00317.72
8.2.10.0100.00018.11
8.2.00.0070.00017.98
8.1.280.0160.00725.92
8.1.270.0060.00323.91
8.1.260.0030.00626.35
8.1.250.0070.00728.09
8.1.240.0110.00420.81
8.1.230.0050.00520.85
8.1.220.0030.00617.79
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.23
8.1.180.0060.00318.10
8.1.170.0090.00018.50
8.1.160.0050.00221.98
8.1.150.0040.00418.74
8.1.140.0030.00519.50
8.1.130.0000.00817.32
8.1.120.0060.00317.33
8.1.110.0040.00417.29
8.1.100.0040.00417.43
8.1.90.0050.00217.41
8.1.80.0030.00317.39
8.1.70.0000.00717.34
8.1.60.0040.00417.50
8.1.50.0040.00417.42
8.1.40.0040.00417.52
8.1.30.0060.00317.55
8.1.20.0000.00817.59
8.1.10.0000.00717.52
8.1.00.0040.00417.46
8.0.300.0020.00519.98
8.0.290.0070.00016.75
8.0.280.0070.00018.43
8.0.270.0050.00217.30
8.0.260.0030.00316.75
8.0.250.0000.00816.93
8.0.240.0030.00316.95
8.0.230.0040.00416.84
8.0.220.0040.00416.87
8.0.210.0000.00816.84
8.0.200.0060.00016.96
8.0.190.0090.00016.86
8.0.180.0000.00716.80
8.0.170.0080.00016.88
8.0.160.0000.00716.81
8.0.150.0050.00316.73
8.0.140.0000.00716.82
8.0.130.0050.00313.34
8.0.120.0050.00316.84
8.0.110.0080.00016.92
8.0.100.0040.00416.75
8.0.90.0000.00916.92
8.0.80.0070.01016.95
8.0.70.0040.00416.76
8.0.60.0000.00716.93
8.0.50.0000.00716.93
8.0.30.0060.01117.02
8.0.20.0090.01217.40
8.0.10.0040.00416.98
8.0.00.0080.01016.66
7.4.330.0030.00316.76
7.4.320.0060.00016.57
7.4.300.0060.00016.55
7.4.290.0050.00316.44
7.4.280.0000.00816.47
7.4.270.0070.00016.66
7.4.260.0040.00416.50
7.4.250.0000.00716.52
7.4.240.0050.00216.54
7.4.230.0040.00416.50
7.4.220.0030.01616.60
7.4.210.0030.01016.45
7.4.200.0040.00416.49
7.4.160.0080.00816.45
7.4.150.0070.01017.40
7.4.140.0140.00717.86
7.4.130.0080.00816.56
7.4.120.0110.00616.55
7.4.110.0110.00716.52
7.4.100.0140.00416.39
7.4.90.0130.00616.46
7.4.80.0130.00319.39
7.4.70.0140.00316.58
7.4.60.0100.00716.46
7.4.50.0060.00916.62
7.4.40.0120.00916.50
7.4.30.0150.00716.61
7.4.00.0070.00715.09
7.3.330.0050.00213.26
7.3.320.0030.00313.27
7.3.310.0030.00316.46
7.3.300.0040.00416.32
7.3.290.0070.00916.31
7.3.280.0080.01016.34
7.3.270.0110.00517.40
7.3.260.0130.00316.61
7.3.250.0080.01116.53
7.3.240.0150.00616.31
7.3.230.0060.01016.54
7.3.210.0070.01016.35
7.3.200.0030.01316.36
7.3.190.0100.01316.48
7.3.180.0030.01316.45
7.3.170.0160.00616.39
7.3.160.0100.00616.43
7.2.330.0040.01216.49
7.2.320.0130.00516.54
7.2.310.0120.01216.51
7.2.300.0060.01216.82
7.2.290.0080.00916.86
7.2.60.0040.00416.89
7.2.00.0070.00719.31
7.1.200.0060.00615.61
7.1.100.0030.00718.26
7.1.70.0070.00416.95
7.1.60.0120.01219.12
7.1.50.0090.00617.05
7.1.00.0000.08022.57
7.0.200.0470.00714.82
7.0.60.0000.06019.91
7.0.50.0000.04017.87
7.0.40.0070.07720.23
7.0.30.0270.04020.01
7.0.20.0230.06720.19
7.0.10.0100.07720.16
7.0.00.0170.07320.01
5.6.280.0000.03321.13
5.6.210.0070.08020.51
5.6.200.0030.06018.11
5.6.190.0000.04720.40
5.6.180.0300.04720.39
5.6.170.0300.06320.50
5.6.160.0000.06720.49
5.6.150.0130.06718.21
5.6.140.0030.08318.18
5.6.130.0000.06318.08
5.6.120.0030.09720.89
5.6.110.0100.08021.01
5.6.100.0130.07720.99
5.6.90.0070.07321.10
5.6.80.0070.07320.54
5.5.350.3970.04020.31
5.5.340.0000.04717.92
5.5.330.0070.07720.19
5.5.320.0070.03720.21
5.5.310.0200.04020.30
5.5.300.0030.08317.91
5.5.290.0070.04018.02
5.5.280.0130.08020.96
5.5.270.0100.08320.95
5.5.260.0200.07020.72
5.5.250.0130.07020.68
5.5.240.0330.07320.25

preferences:
55.71 ms | 404 KiB | 6 Q