codeformater报错,不支持each()方法

18 篇文章 0 订阅
unable to auto detect encoding for C:\Users\admin\AppData\Roaming\Sublime Text 3\Packages\CodeFormatter\codeformatter\lib\phpbeautifier\phpf.phar, using fallback encoding Western (Windows 1252)
Detected ISO-8859-2 vs Western (Windows 1252) with 73% confidence
error: CodeFormatter

Format error:
PHP Deprecated:  The each() function is deprecated. This message will be suppressed on further calls in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 11054
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 11054
PHP Notice:  Trying to access array offset on value of type bool in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7267
Notice: Trying to access array offset on value of type bool in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 7267
PHP Deprecated:  strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
Deprecated: strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
PHP Deprecated:  strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
Deprecated: strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
PHP Deprecated:  strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
Deprecated: strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
PHP Deprecated:  strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
Deprecated: strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
PHP Deprecated:  strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211
Deprecated: strrchr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in phar://C:/Users/admin/AppData/Roaming/Sublime Text 3/Packages/CodeFormatter/codeformatter/lib/phpbeautifier/phpf.phar/phpf.php on line 12211

原因是自从php7.2之后就废弃了each方法,我的php版本是7.4,所以有两个办法。

1.安装个php7.2以下的版本

2.使用其语法检测器

https://cs.symfony.com/

https://github.com/akalongman/sublimetext-codeformatter/issues/355

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SHUIPING_YANG

你的鼓励是我创作的最大动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值