- Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
- Fatal error: Cannot use 'parent' as class name as it is reserved in /in/uAsO6 on line 12
Process exited with code 255.
<?php
class Dad {
public function early() {
print __CLASS__ . PHP_EOL;
}
public function late() {
print get_class($this) . PHP_EOL;
}
}
class Child extends Parent {}
$parent = new Dad();
$child = new Child();
print 'PARENT' . PHP_EOL;
$parent->early();
$parent->late();
print 'CHILD' . PHP_EOL;
$child->early();
$child->late();