PHP 错误 Unparenthesized `a ? b : c ? d : e` is not supported

2024-04-28 18:04

本文主要是介绍PHP 错误 Unparenthesized `a ? b : c ? d : e` is not supported,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

最近在一个新的服务器上测试一些老代码的时候得到了类似上面的错误:

[Thu Apr 25 07:37:34.139768 2024] [php:error] [pid 691410] [client 192.168.1.229:57183] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/massnet/wp-content/themes/enfold/functions-enfold.php on line 265
[Thu Apr 25 07:37:35.883933 2024] [php:error] [pid 691415] [client 192.168.1.229:57182] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/massnet/wp-content/themes/enfold/functions-enfold.php on line 265
[Thu Apr 25 07:37:36.665729 2024] [php:error] [pid 691411] [client 192.168.1.229:57189] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/massnet/wp-content/themes/enfold/functions-enfold.php on line 265
[Thu Apr 25 07:37:36.864684 2024] [php:error] [pid 691412] [client 192.168.1.229:57191] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/massnet/wp-content/themes/enfold/functions-enfold.php on line 265
[Thu Apr 25 07:37:37.059653 2024] [php:error] [pid 691413] [client 192.168.1.229:57193] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/massnet/wp-content/themes/enfold/functions-enfold.php on line 265
[Thu Apr 25 07:37:37.266231 2024] [php:error] [pid 691414] [client 192.168.1.229:57195] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/massnet/wp-content/themes/enfold/functions-enfold.php on line 265
[Thu Apr 25 07:37:37.474902 2024] [php:error] [pid 691410] [client 192.168.1.229:57197] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/massnet/wp-content/themes/enfold/functions-enfold.php on line 265
~                                                                                                                                                                                                                                                                                                             

2024-04-25_13-22-44

错误原因

a ? b : c 这是一种常见的三元运算符 意思是如果 a成立那么结果就返回b 否则返回c

a ? b : c ? d : e 当你这么写时 程序就会有多种理解了

一种是 (a ? b : c) ? d : e 把前面的当做了一个整体

另一种是 a ? b : (c ? d : e) 把后面的当做了一个整体

在 PHP 8 中,这种错误被标记为严重错误。

出现上面的原因是 PHP 8 升级的问题。

这个问题出现在我们 WP 安装的插件上,为了避免这个问题,要么需要更新插件的版本,要么就不要更新 PHP 的版本。

感觉 PHP 8 升级后,不少插件的作者都没有来得及更新,也引起了不少的问题。

PHP 错误 Unparenthesized `a ? b : c ? d : e` is not supported. Use eithe - PHP - iSharkFly最近在一个新的服务器上测试一些老代码的时候得到了类似上面的错误: [Thu Apr 25 07:37:34.139768 2024] [php:error] [pid 691410] [client 192.168.1.229:57183] PHP Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? …icon-default.png?t=N7T8https://www.isharkfly.com/t/php-unparenthesized-a-b-c-d-e-is-not-supported-use-eithe/15665

这篇关于PHP 错误 Unparenthesized `a ? b : c ? d : e` is not supported的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/943890

相关文章

C/C++错误信息处理的常见方法及函数

《C/C++错误信息处理的常见方法及函数》C/C++是两种广泛使用的编程语言,特别是在系统编程、嵌入式开发以及高性能计算领域,:本文主要介绍C/C++错误信息处理的常见方法及函数,文中通过代码介绍... 目录前言1. errno 和 perror()示例:2. strerror()示例:3. perror(

Go标准库常见错误分析和解决办法

《Go标准库常见错误分析和解决办法》Go语言的标准库为开发者提供了丰富且高效的工具,涵盖了从网络编程到文件操作等各个方面,然而,标准库虽好,使用不当却可能适得其反,正所谓工欲善其事,必先利其器,本文将... 目录1. 使用了错误的time.Duration2. time.After导致的内存泄漏3. jsO

Python中ModuleNotFoundError: No module named ‘timm’的错误解决

《Python中ModuleNotFoundError:Nomodulenamed‘timm’的错误解决》本文主要介绍了Python中ModuleNotFoundError:Nomodulen... 目录一、引言二、错误原因分析三、解决办法1.安装timm模块2. 检查python环境3. 解决安装路径问题

如何解决mysql出现Incorrect string value for column ‘表项‘ at row 1错误问题

《如何解决mysql出现Incorrectstringvalueforcolumn‘表项‘atrow1错误问题》:本文主要介绍如何解决mysql出现Incorrectstringv... 目录mysql出现Incorrect string value for column ‘表项‘ at row 1错误报错

SpringBoot项目启动错误:找不到或无法加载主类的几种解决方法

《SpringBoot项目启动错误:找不到或无法加载主类的几种解决方法》本文主要介绍了SpringBoot项目启动错误:找不到或无法加载主类的几种解决方法,具有一定的参考价值,感兴趣的可以了解一下... 目录方法1:更改IDE配置方法2:在Eclipse中清理项目方法3:使用Maven命令行在开发Sprin

前端bug调试的方法技巧及常见错误

《前端bug调试的方法技巧及常见错误》:本文主要介绍编程中常见的报错和Bug,以及调试的重要性,调试的基本流程是通过缩小范围来定位问题,并给出了推测法、删除代码法、console调试和debugg... 目录调试基本流程调试方法排查bug的两大技巧如何看控制台报错前端常见错误取值调用报错资源引入错误解析错误

部署Vue项目到服务器后404错误的原因及解决方案

《部署Vue项目到服务器后404错误的原因及解决方案》文章介绍了Vue项目部署步骤以及404错误的解决方案,部署步骤包括构建项目、上传文件、配置Web服务器、重启Nginx和访问域名,404错误通常是... 目录一、vue项目部署步骤二、404错误原因及解决方案错误场景原因分析解决方案一、Vue项目部署步骤

在MySQL执行UPDATE语句时遇到的错误1175的解决方案

《在MySQL执行UPDATE语句时遇到的错误1175的解决方案》MySQL安全更新模式(SafeUpdateMode)限制了UPDATE和DELETE操作,要求使用WHERE子句时必须基于主键或索引... mysql 中遇到的 Error Code: 1175 是由于启用了 安全更新模式(Safe Upd

SpringBoot中的404错误:原因、影响及解决策略

《SpringBoot中的404错误:原因、影响及解决策略》本文详细介绍了SpringBoot中404错误的出现原因、影响以及处理策略,404错误常见于URL路径错误、控制器配置问题、静态资源配置错误... 目录Spring Boot中的404错误:原因、影响及处理策略404错误的出现原因1. URL路径错

Spring常见错误之Web嵌套对象校验失效解决办法

《Spring常见错误之Web嵌套对象校验失效解决办法》:本文主要介绍Spring常见错误之Web嵌套对象校验失效解决的相关资料,通过在Phone对象上添加@Valid注解,问题得以解决,需要的朋... 目录问题复现案例解析问题修正总结  问题复现当开发一个学籍管理系统时,我们会提供了一个 API 接口去