I have some strange issue with isset() function in PHP.
Let me show… .
<?php
$aTestArray = array(
'index' => array(
'index' => 'Główna'
),
'dodaj' => 'Dodaj ogłoszenie',
);
var_dump( isset($aTestArray['index']) );
var_dump( isset($aTestArray['index']['index']) );
var_dump( isset($aTestArray['dodaj']) );
var_dump( isset($aTestArray['index']['none']) );
var_dump( isset($aTestArray['index']['none']['none2']) );
// This unexpectedly returns TRUE
var_dump( isset($aTestArray['dodaj']['none']) );
var_dump( isset($aTestArray['dodaj']['none']['none2']) );
?>
The var_dump’s will return:
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
bool(true)
bool(false)
Why the sixth var_dump() return TRUE ?
When using the
[]operators on a string, it will expect an integer value. If it does not get one, it will convert it.['none']is converted to[0]which, in your case, is aD.