In PHP7 env, I have the follow code:
try {
echo strlen([123]);
} catch (Exception $e) {
echo 'error...';
}
Because [123]
is not string
, I want it to output error...
, but it outputs:
Warning: strlen() expects parameter 1 to be string, array given
Why?
No comments:
Post a Comment