Created
February 12, 2014 22:07
-
-
Save fredemmott/8965518 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fredemmott-mbp1:~ fredemmott$ cat test.php | |
<?php | |
$keys = array(3.141); | |
var_dump(array_fill_keys($keys, 'value')); | |
$foo = array(); | |
$foo[3.141] = 'value'; | |
var_dump($foo); | |
fredemmott-mbp1:~ fredemmott$ php test.php | |
array(1) { | |
["3.141"]=> | |
string(5) "value" | |
} | |
array(1) { | |
[3]=> | |
string(5) "value" | |
} | |
fredemmott-mbp1:~ fredemmott$ php --version | |
PHP 5.4.17 (cli) (built: Sep 12 2013 23:14:23) | |
Copyright (c) 1997-2013 The PHP Group | |
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment