Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cannot Use Isset On Expression, So Use What?

<?php

var_dump(isset(NULL !== A));
    
// Fatal error: Cannot use Isset() on the result of an expression

isset() works on data containers, such as variables, properties, array elements, but not on literal or constant values.

For literal values, it is recommended to avoid using isset, but make a comparison to null, instead.

And of course, the error message is the same when the code uses both solutions at the same time. This may lead to confusion: the message suggests using null !== (NULL !== A), instead of isset(NULL !== A).

See Also

PHP Error Messages

PHP Features

Last updated: 10 September 2026