Reputation: 679
I should be getting an offset warning error in this code but it shows nothing. What am i missing ?
I have turned on error reporting etc.
<?php
$info = null;
$value = 'string';
if ($value == $info['firstname']){
echo 'true';
}else{
echo 'false';
}
?>
Upvotes: 2
Views: 62
Reputation: 978
Prior to version 7.4 Undefined index
throws for arrays only:
<?php
$info = [];
$value = 'string';
if ($value == $info['firstname']) {
echo 'true';
} else {
echo 'false';
}
?>
Upvotes: 3