discussing with a friend of my work, we discover something weird about PHP. Let's get the following code:
<?php
$leo = false;
$retorno = $leo[0];
var_dump($retorno);
The return of var_dump() is NULL. Now, the thing is, why is returning NULL, if we are trying to access a bool as array?
The correct behavior isn't throw an exception telling us, that we are trying to access a non-array object as array (in this case a boolean var)?
what you guys think about that?
$s = 'asdf'; echo $s['f'];. Now it will give you a warning saying that the offset does not exist.