3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ThingDoer { protected $things; public function __construct(string $string = '') { $this->things[] = $string; } public function do() { print_r($this->things); } } $thing = new ThingDoer(); $thing->do();
Output for hhvm-3.15.4, 7.0.0 - 7.2.6
Array ( [0] => )
Output for 5.6.0 - 5.6.30
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/FpcdV on line 6
Process exited with code 255.