phpQuery和create_function

给鸟类名称查询加点美观的新功能:为每种鸟配一幅图片。编程过程中留意到phpQuery宣称的很多过滤器——如:header、:nth-child——都不好用,系统报错都说“create_function有问题”。
查查PHP手册,原来create_function在PHP 7.2.0时已过时,到8.0.0时已过世。手册建议改写成匿名函数。改写也不难,就是找到所有的(共11处)
create_function('$params', 'codes that use $params')
把它们改写成:
function($params){codes that use $params}
改完一跑,效果还不错呢,算是把半残的phpQuery医治好了。
受影响的过滤器至少有这些:
:parent :empty :enabled :header :only-child
:first-child :last-child :nth-child


