3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class X { public function each($function) { for($i=0; $i<3; $i++) { call_user_func($function, $i); } } public function isEqual($value, &$a = null, &$b = null) { $a = $value; $b = 1; return $a == $b; } public function action($force = false) { $this->each(function($i) { if (isEqual($i, $a, $b) || $force) { echo $i . PHP_EOL; } } } } $a = new X(); $a->action(); $a->action(true);
based on UNpWO
Output for 7.0.0
Parse error: syntax error, unexpected '}', expecting ',' or ')' in /in/hZciN on line 26
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected '}' in /in/hZciN on line 26
Process exited with code 255.