- Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16, 7.0.0 - 7.0.1
- Parse error: syntax error, unexpected 'onst' (T_STRING), expecting function (T_FUNCTION) in /in/78ZZ0 on line 16
Process exited with code 255.
<?php
abstract class Human {
const NAME = 'abstract';
public function getName() {
return static::NAME;
}
}
class John extends Human {
const NAME = 'John';
}
class Mark extends John {
onst NAME = 'Mark';
}
$mark = new Mark();
$johh = new John();
echo $mark->getName();
echo "\n";
echo $john->getName();