<?php
abstract class Base { public function foo() { return 'bar'; } }
class Foo extends Base { public function foo() { return 'baz - '.parent::foo(); } }
$obj = new Foo();
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/eKpFr on line 4
string(9) "baz - bar"
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/eKpFr on line 2
Process exited with code 255.