3v4l.org

run code in 200+ php & hhvm versions
<?php var_dump(new class() { public int $bar; public function __construct() { $this->bar = "42"; } });

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
object(class@anonymous)#1 (1) { ["bar"]=> int(42) }
Output for Lexical anon
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/O4bdX on line 2
Process exited with code 255.

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page