I come from the background of python, and the python data type, which is similar (dictionary), is a collection of unordered key value pairs.
I am wondering if the set of associative arrays of PHP is disordered? It seems that they are ordered.
$test = array( 'test' => 'test', 'bar' => 'bar', ); var_dump($test); var_dump(array_slice($test, 0, 1));
The test always comes in front of the bar, and I can slice this array, as you see. So is it always guaranteed that you order through php versions? Is the order only the order with which I declared the array? So, does something internally indicate a βtestβ to place [0] in the array? I read http://php.net/manual/en/language.types.array.php , but it does not shed too much light on this problem. I appreciate your answers. Ty
dictionary arrays php
dm03514 Jun 06 2018-12-06T00: 00Z
source share