- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
- Parse error: syntax error, unexpected '(', expecting '{' in /in/7hmTG on line 2
Process exited with code 255.
<?php
class derp() {
public function __construct($v) {
$this->num = $v;
}
public function getNum() {
return $this->num;
}
}
$d = array();
for($i = 0; $i < 100; $i++) {
$d[] = new derp(rand(1,100));
}
$nums = array_reduce($d, function($derp, $nums) {
$nums += $derp->getNum();
});
var_dump($nums);