I am trying to call one of my object methods from an anonymous function array_map. While I get the expected error:
Fatal error: using $ this if not in the context of an object in ...
I know why I get this error, I just don’t know how to get what I'm trying to ... Does anyone have any suggestions?
Here is my current code:
array_map(function($value){
return $this->some_method($value,'value',false);
},$this->mssql->data[0]['results'][0]);
source
share