什么意思是数组($ this,$ some_method_string)?

use*_*830 9 php arrays methods

对不起,如果看起来很简单,但这是什么意思:

array($this, $some_method_string)
Run Code Online (Sandbox Code Playgroud)

在这段代码中:

array_map(array($this, $some_method_string), $some_data)
Run Code Online (Sandbox Code Playgroud)

mpm*_*mpm 7

array($this, $some_method_string)
Run Code Online (Sandbox Code Playgroud)

它是一个有效的回调,在$ this上调用方法$ some_method_string:

使用array_map,对于$ some_data的每个元素,调用 $this->$some_method_string(currentElement)