-
Improvement
-
Resolution: Done
-
Minor
-
None
-
4.4
-
MOODLE_404_STABLE
https://php.watch/versions/8.3/dynamic-class-const-enum-member-syntax-support
PHP 8.3 and later supports fetching class constants and Enum objects with a variable name.
class MyClass
{ public const MY_CONST = 42; }$constName = 'MY_CONST';
echo MyClass::{$constName};
Prior to PHP 8.3, the ClassName::{$varName} syntax of accessing class constants was not allowed, and resulted in a syntax error:
Parse error: syntax error, unexpected token ";", expecting "(" in ... on line ...
Required
- Confirm my assessment that no change is required
- has a non-specific relationship to
-
MDL-80144 Validation only: Confirm a collection of PHP 8.3 issues are no-op
-
- Closed
-