- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.22
- Parse error: syntax error, unexpected '=' in /in/940Bs on line 12
Process exited with code 255.
<?php
$closures = array();
$simple_closure = function() { return 'hello world';};
for ($x=0; $x < 2; $x++) {
$closures[$x] = $simple_closure;
}
$obj1 = new stdClass;
$obj1.color = "red";
$obj2 = new stdClass;
$obj2.color = "blue"
$c1 = Closure::bind($closures[0], $obj1);
$c2 = Closure::bind($closures[1], $obj2);
var_dump($c1,$c2);
print "<span style='$obj1.color'>",$c1(),'</span>';
print "<span style='$obj2.color'>",$c2(),'</span>';