Is it legal to do something like this (without warnings):
$code = [
0=>'code0',
1=>'code1'
];
$key = 3;
echo $code[$key] ?: 'unknown';
I.e. using ?:
instead to do:
echo isset($code[$key]) ? $code[$key] : 'unknown';
PHP > 5.3
Is it legal to do something like this (without warnings):
$code = [
0=>'code0',
1=>'code1'
];
$key = 3;
echo $code[$key] ?: 'unknown';
I.e. using ?:
instead to do:
echo isset($code[$key]) ? $code[$key] : 'unknown';
PHP > 5.3