如何修复验证码 php 文件中的此错误

问题描述 投票:0回答:1

我收到以下错误消息:

致命错误:无法对表达式的结果使用 isset()(可以使用“null !== expression”代替)

它引用的代码是这个

$data['route'] = (isset($this->request->get['route']??$this->config->get('action_default'))) ? $this->request->get['route']??$this->config->get('action_default') : ''; 

在我的谷歌验证码文件中。它应该是什么样子?

还没有尝试过任何东西,自从我编写任何代码以来已经有一段时间了,所以我想在使用它之前我会得到一些指示。

php isset
1个回答
0
投票

我通过将代码更改为这样解决了问题

$data['route'] = ((null !== ($this->request->get['route'] ?? null)) ? ($this->request->get['route'] ? ? $this->config->get('action_default')) : '');

看来已经奏效了。

© www.soinside.com 2019 - 2024. All rights reserved.