PHP Closures scoping of variables

后端 未结 3 1205
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 16:15

I am looking at the PHP example of Closures on http://us1.php.net/manual/en/functions.anonymous.php

It provides the example code below and states:

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 16:42

    The two variable is question are what get passed into the callback by array_walk.

    The first parameter will be passed as the value of each of the elements in the array, the second will be the key of the array.

    The closed over variables are the ones referenced in the use clause.

提交回复
热议问题