3v4l.org

run code in 300+ PHP versions simultaneously
<?php $object = new stdClass(); $object->{'1'} = 'one'; echo $object->{'1'}; $array = (array) $object; $test = {'1'}; echo $array[test]; //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)
5.6.150.0100.07718.29
5.6.140.0070.05318.17
5.6.130.0070.04018.18
5.6.120.0030.05321.02
5.6.110.0030.08721.11
5.6.100.0130.08021.00
5.6.90.0170.04320.88
5.6.80.0070.03720.39
5.5.300.0070.08317.91
5.5.290.0070.07717.94
5.5.280.0130.07320.86
5.5.270.0130.08020.67
5.5.260.0100.08020.89
5.5.250.0100.08320.61
5.5.240.0230.07320.28

preferences:
140.06 ms | 1394 KiB | 7 Q