3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $path; public function __construct($config) { if (empty($config['path'])) { return false; } $this->path = $config['path']; } public function doSomethingWithPath() { var_dump($this->path); } } $foo = new Foo(); $foo->doSomethingWithPath();
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Foo::__construct(), 0 passed in /in/fEhrA on line 22 and exactly 1 expected in /in/fEhrA:7 Stack trace: #0 /in/fEhrA(22): Foo->__construct() #1 {main} thrown in /in/fEhrA on line 7
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Warning: Missing argument 1 for Foo::__construct(), called in /in/fEhrA on line 22 and defined in /in/fEhrA on line 7 NULL