3v4l.org

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