Are isset() and !== null equivalent?

null, php

Solution

From PHP Manual:

isset — Determine if a variable is set and is not NULL

isset Returns TRUE if var exists and has value other than NULL, FALSE otherwise.

http://php.net/manual/en/function.isset.php

The function call overhead is so small you probably don't need to worry about it. Read this post: Why are PHP function calls *so* expensive?

Note that isset is not a function (it has a special opcode for it), so it's faster.

Problem

Since `isset` appears to be a function (http://php.net/manual/en/function.isset.php), there might be some overhead for calling it. So I wonder if using `!== null` instead of `isset` would produce faster code while, most importantly, keeping the code's behavior exactly the same?

Original source

Related problems