I want to use array_map with a static method, but I fail. Here is my code:
Class Buy { public function payAllBills() { $bill_list = OtherClass::getBillList(); return array_map(array(self, 'pay'), $bill_list);
PHP gives me an error:
Use of undefined constant self - assumed 'self'
I also tried:
return array_map('self::makeBean()', $model_list);
But that will not work.
Do you have any idea on how to use array_map with a static method?
I already read: Can a method be used as an array_map function in PHP 5.2? , but this question is about standard methods, not statics.
source share