jae-jae / QueryList

:spider: The progressive PHP crawler framework! 优雅的渐进式PHP采集框架。
https://querylist.cc
2.65k stars 440 forks source link

each() 函数已在 php 7.2 以上版本被移除,是否可以兼容一下高版本的 php 语言呢~ #129

Closed zhaoqinghuan closed 3 years ago

zhaoqinghuan commented 3 years ago

如题所示。 image image

jae-jae commented 3 years ago

你使用的是 QueryList 那个版本?

zhaoqinghuan commented 3 years ago

你使用的是 QueryList 那个版本? image 3.2.1

jae-jae commented 3 years ago

QueryList 3 版本已经不再维护了,目前的解决方法只能是你自己 fork 一份代码,然后去维护了

geelinsir commented 1 year ago

可以考虑重写each函数: function each(&$array){ $res = array(); $key = key($array); if($key !== null){ next($array); $res[1] = $res['value'] = $array[$key]; $res[0] = $res['key'] = $key; }else{ $res = false; } return $res; }