Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does mean array($this, $some_method_string )?

Sorry if it might appear very simple, but what does that mean:

array($this, $some_method_string)

in this piece of code:

array_map(array($this, $some_method_string), $some_data)
like image 326
user1611830 Avatar asked Jan 27 '13 23:01

user1611830


1 Answers

array($this, $some_method_string)

it is a valid callback , calling the method $some_method_string on $this :

with array_map , for every element of $some_data , call $this->$some_method_string(currentElement)

like image 162
mpm Avatar answered Nov 16 '22 17:11

mpm