PHP Puzzlers #2
Here’s another short post detailing some odd behavior in PHP.
Let’s have a look at the following simple piece of code:
$arr = array(
1 => 'Hello',
1.5 =>'World',
true=>"!"
);
var_dump($arr);
What would the output of this be? Surprisingly this does the following:
array(1) {
[1]=>
string(1 ...