3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php <?hh namespace Hack\UserDocumentation\Quickstart\Examples\First; class Box<T> { public function __construct(private T $elem) { } public function get(): T { return $this->elem; } } function get_int(): int { return 42; } function use_box(): void { $box = new Box(get_int()); $i = $box->get(); var_dump($i); } use_box();
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '<', expecting end of file in /in/rjPFl on line 2
Process exited with code 255.
Output for 5.3.22 - 5.6.17
Parse error: syntax error, unexpected '<' in /in/rjPFl on line 2
Process exited with code 255.