<?php
abstract class Base {
private $foo;
public function setFoo($foo) { $this->foo = $foo; }
public function foo() { return $this->foo; }
}
class Foo extends Base {
public function foo() { return ' - '.parent::foo(); }
}
$obj = new Foo();
$obj->setFoo('yay');
var_dump($obj->foo());
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/FPU4U on line 10
string(6) " - yay"
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/FPU4U on line 2
Process exited with code 255.