$a = array ( ‘Book’ => array ( ‘isbn’ => 1 ) );var_dump ( isset($a[‘Book’][‘isbn’][‘bla_bla’]) ) will return TRUE ..
April 19, 2011
PHP isset bug or WAD!?
Consider the array
The isset function instead of check if there is an array index on that position, it don’t and returns TRUE for any value besides 0 or false, making a possible validation wrong and your logic to mess up.
The same happens with !empty function from PHP.
Is it a bug? Not really. both isset and empty functions uses mixed as parameter and mixed means that the param can be anything, from a value to a array index.
This kind of stuff can make you have some troubleshooting fun for the longest of times.