- var_dump: documentation ( source)
<?php
$closures = array();
$simple_closure = function() { return 'hello world';};
for ($x=0; $x < 2; $x++) {
$closures[$x] = $simple_closure;
}
$obj1 = new stdClass;
$obj2 = new stdClass;
$c1 = Closure::bind($closures[0], $obj1);
$c2 = Closure::bind($closures[1], $obj2);
var_dump($c1,$c2);
print $c1();
print $c2();