Cannot use ‘final’ as constant modifier
Description
final is an option for methods, and it is not available for class constants and properties. It becomes a feature with class constants in PHP 8.0.
Example
<?php
class X {
private static const A = 1;
}
?>
Alternatives
- Remove the option from the constant signature.
In more recent PHP versions, this error message is now :ref:cannot-use-the-%s-modifier-on-a-%s.