-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Description
Description
The following code:
<?php
class X {
const A = '1';
}
$c = 'b';
isset(X::{$c}); Resulted in this (valid) output:
atal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
but I cannot use null !== X::{$c}, which also yields a Fatal Error.
With a constant, this message should recommend using 'defined()' instead, or on top of the current recommendation.
PHP Version
Tested on PHP 8.5, but any version since 8.3
Operating System
Not applicable.
Reactions are currently unavailable