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($name); } } $user = new Person('chris'); var_dump($user->name());
based on W8rDQ
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Person::name(), 0 passed in /in/8n67u on line 21 and exactly 1 expected in /in/8n67u:11 Stack trace: #0 /in/8n67u(21): Person->name() #1 {main} thrown in /in/8n67u 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/8n67u on line 21 and defined in /in/8n67u on line 11 Notice: Undefined variable: name in /in/8n67u on line 13 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /in/8n67u on line 13
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Warning: Missing argument 1 for Person::name(), called in /in/8n67u on line 21 and defined in /in/8n67u on line 11 Notice: Undefined variable: name in /in/8n67u on line 13 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 130968 bytes) in /in/8n67u on line 13
Process exited with code 255.
Output for 5.3.17 - 5.3.29
Warning: Missing argument 1 for Person::name(), called in /in/8n67u on line 21 and defined in /in/8n67u on line 11 Notice: Undefined variable: name in /in/8n67u on line 13 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 523800 bytes) in /in/8n67u on line 13
Process exited with code 255.