<?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());
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.
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.