php - 如何修复 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);
解决方案
该??
运算符是在 php 7 中引入的。您应该将您的 php 版本升级到您正在使用的 laravel 版本所需的版本。
推荐阅读
- reactjs - react-select 如何在选项上添加隐藏类型
- java - 通过强制转换将 groupBy 流式传输到嵌套地图
- spring-batch - 将块侦听器用于指标模式
- reactjs - 单元测试 TypeError:_reactRouterDom.useHistory.mockReturnValue 不是函数
- web - 如何根据国家/地区和 Shopify 中产品的重量设置运费?
- c++ - 当源文件需要使用相同的对象时有什么好的做法
- ios - iOS,辅助功能-accessibilityElementsHidden = NO;不会立即生效
- apache-nifi - 如何在 Apache Nifi 中将 XML 解析为 JSON
- javascript - js中的产品标签
- kubernetes - 通过 Istio egressgateway 路由 TCP 流量