<?php
class foo
{
private $name;
public function greet2()
{
$this->greet('jan');
echo $this->name;
}
private function greet($name)
{
$this->name = $name;
}
}
class bar extends foo
{
public function greet()
{
echo "Hello";
}
}
$bar = new bar;
$bar->greet();
$bar->greet2();
Strict Standards: Declaration of bar::greet() should be compatible with that of foo::greet() in /in/iHdg6 on line 24
Hellojan
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/iHdg6 on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/iHdg6 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/iHdg6 on line 5
Process exited with code 255.