A class-handling friend with a way to sync friends, and this method needs to find the users who are concerned with each other from the list of followers and fans on the microblog, and record the experience, mostly about the callback function.
As I understand it, that's all you have to say.
Private function Getmutualfromsina ($focusList) { returnarray_filter( $focusList, "filtersinalist");} Private function filtersinalist ($value) { returnin_array( $value $this, fanslist);}
However, a warning is returned after execution:
Array_filter () [function. Array callback in * * * * on line 11
Later, the callback function called in the class should be written like this:
Private function Getmutualfromsina ($focusList) { returnarray_filter( $focusList Array ($this, "filtersinalist");} Private function filtersinalist ($value) { returnin_array( $value $this, fanslist);}
is equivalent to invoking the method normally in the class: $this->xxxx ()
php– problems with callback functions when using Array_filter in a class