The callback of array_filter returns null

Why NULL is returned can"t be understood

dump($info);
dump(function_exists("wx_user_info_filter"));
dump(wx_user_info_filter("groupid"));
dump(array_filter($info,"wx_user_info_filter",ARRAY_FILTER_USE_KEY));
/**
 * @param $k
 * @return bool
 */
function wx_user_info_filter($k){
    $arr=array("groupid","subscribe_scene","tagid_list","qr_scene","qr_scene_str");
    if((boolean) in_array(strtolower($k),$arr)){
        return false;
    }else{
        return true;
    }
}
array(17) {
  ["subscribe"] => int(1)
  ["openid"] => string(28) "xxxxxxxx"
  ["nickname"] => string(11) "xxxxxxxx"
  ["sex"] => int(1)
  ["language"] => string(5) "xxxxxxxx"
  ["city"] => string(6) "xxxxxxxx"
  ["province"] => string(6) "xxxxxxxx"
  ["country"] => string(6) "xxxxxxxx"
  ["headimgurl"] => string(133) "xxxxxxxx"
  ["subscribe_time"] => int(1540366847)
  ["remark"] => string(0) ""
  ["groupid"] => int(0)
  ["tagid_list"] => array(0) {
  }
  ["subscribe_scene"] => string(16) "ADD_SCENE_SEARCH"
  ["qr_scene"] => int(0)
  ["qr_scene_str"] => string(0) ""
  ["group_id"] => int(0)
}
bool(true)
bool(false)
NULL
Php
Sep.16,2021

upgrade your php version

php5.4 does not support ARRAY_FILTER_USE_KEY

clipboard.png

=

php 7.1 did not reappear.

Menu