I'm running Laravel Herd on a Mac with PHP v8.4.
And after I run composer update
to upgrade from v10 to v11 I see this message in my application.
unexpected token "readonly", expecting "abstract" or "final" or "class" in sebastian/version/src/Version.php on line 23
Could I have PHP libraries that need an additional update?
I'm running Laravel Herd on a Mac with PHP v8.4.
And after I run composer update
to upgrade from v10 to v11 I see this message in my application.
unexpected token "readonly", expecting "abstract" or "final" or "class" in sebastian/version/src/Version.php on line 23
Could I have PHP libraries that need an additional update?
Share Improve this question edited Feb 4 at 20:02 hakre 199k55 gold badges450 silver badges856 bronze badges Recognized by PHP Collective asked Feb 4 at 18:27 Bob.Bob. 1,6591 gold badge15 silver badges22 bronze badges 1- 4 Are you 100% sure you are running PHP 8.4? – Borjante Commented Feb 4 at 18:45
1 Answer
Reset to default 4You're running the wrong version of PHP. You've got packages installed that are for 8.4, but you're running it through PHP 8.1 or lower, as readonly
was introduced in 8.2.
You can see the class you're hitting the error on: https://github/sebastianbergmann/version/blob/main/src/Version.php#L26
And here's information about readonly
classes: https://stitcher.io/blog/readonly-classes-in-php-82