首页 > 解决方案 > 如何修复 PHP Parse 错误:语法错误,意外的“?” 在第 500 行的 vendor\laravel\framework\src\Illuminate\Foundation\helpers.php

问题描述

一切正常,但在运行时出现此错误

PHP 解析错误:语法错误,意外的“?” 在 htdocs\example\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php 第 500 行

上线500

return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);

标签: phplaravel

解决方案


??运算符是在 php 7 中引入的。您应该将您的 php 版本升级到您正在使用的 laravel 版本所需的版本。


推荐阅读