3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { public static function status() { self::getStatus(); } protected static function getStatus() { echo "Person is alive"; } } //If we call Person::status() we will see "Person is alive" . Now consider what happens when we make a class that inherits from this: class Deceased extends Person { protected static function getStatus() { echo "Person is deceased"; } } Deceased::status()
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected end of file in /in/Jncbi on line 28
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/Jncbi on line 28
Process exited with code 255.

preferences:
165.46 ms | 1395 KiB | 60 Q