My Code:
$a = [];
isset($a[0]) and unset($a[0]);
it shows "syntax error, unexpected 'unset' (T_UNSET)"
but
$a = [];
isset($a[0]) and exit();
it works!
Both of exit()
and unset()
are returning no value. Why does one work but not the other?
As I asked in comments and you said you want to delete a value from Array,
Why not simply write