TimerWarning: count(): Parameter must be an array or an object that implements Countable in /xxx/xxx.php on line 71错误解决方式

发表于 2020-06-01  468 次阅读


部署了一个php云函数,运行时候出现TimerWarning: count(): Parameter must be an array or an object that implements Countable in /xxx/xxx.php on line 71错误

原71行代码for ($j = 0; $j < count($songlist["privileges"]); $j++) {

这里的count()参数本来就是js数组啊,没得办法,给加了个(array)

变成了for ($j = 0; $j < count((array)$songlist["privileges"]); $j++) {

再跑一下,没事了

本站文章基于国际协议BY-NA-SA 4.0协议共享;
如未特殊说明,本站文章皆为原创文章,请规范转载。

0

心虽在此,逐梦繁星