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¶
isset on expression [Try me]
PHP Error Messages¶
PHP Features¶
Last updated: 14 July 2026