3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Test { function printMe(); } trait T { public function justDoIt() { echo "Just Do IT!" . PHP_EOL; return $this; } } (new class(7) implements Test { private $value; use T; public function __construct(int $value) { $this->value = $value; } public function printMe() { echo $this->value . PHP_EOL; return $this; } })->printMe()->justDoIt();
based on 8VDKl
Output for hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0beta1
7 Just Do IT!
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/I87FU on line 13
Process exited with code 255.