最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

laravel - Unexpected token "readonly", expecting "abstract" or "final" or

programmeradmin0浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 4

You'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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论