3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Person { public $name; public function __construct() { $this->name(); } public function name($name) { return $this>name($name); } } $user = new Person; var_dump($user->name('chris'));
based on CV3ii
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Person::name(), 0 passed in /in/Om0oi on line 8 and exactly 1 expected in /in/Om0oi:11 Stack trace: #0 /in/Om0oi(8): Person->name() #1 /in/Om0oi(18): Person->__construct() #2 {main} thrown in /in/Om0oi on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for Person::name(), called in /in/Om0oi on line 8 and defined in /in/Om0oi on line 11 Fatal error: Uncaught Error: Call to undefined function name() in /in/Om0oi:13 Stack trace: #0 /in/Om0oi(8): Person->name() #1 /in/Om0oi(18): Person->__construct() #2 {main} thrown in /in/Om0oi on line 13
Process exited with code 255.
Output for 5.3.17 - 5.6.28
Warning: Missing argument 1 for Person::name(), called in /in/Om0oi on line 8 and defined in /in/Om0oi on line 11 Fatal error: Call to undefined function name() in /in/Om0oi on line 13
Process exited with code 255.