3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Number { private $v = 0; public function __construct($v) { $this->v = $v; } public function mul() { return function ($x) { return $this->v * $x; }; $one = new Number(1); $two = new Number(2); $double = $two->mul()->bindTo($one); echo $double(5);
Output for 7.1.6 - 7.2.3
Parse error: syntax error, unexpected end of file in /in/6qCQb on line 10
Process exited with code 255.