3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class lol { private function __construct() {} private function sayHello() { echo "Hello"; } } class rofl extends lol { public function __construct() { echo "hi"; } public function sayHello() { self::sayHello(); echo "Not hello"; } } $thing = new rofl(); $thing->sayHello();
based on Y5SSM
Output for 7.0.0 - 7.0.16, 7.0.18 - 7.1.7, 7.1.20 - 7.2.6
hi Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /in/v27Ed on line 17
Process exited with code 255.
Output for 7.0.17, 7.1.10
hi
Process exited with code 137.
Output for hhvm-3.15.4
hi Assertion failure: /tmp/tmp.IY1ufrEsc9/hphp/runtime/base/runtime-error.cpp:48: void HPHP::raise_error(const string&): assertion `0' failed.
Process exited with code 134.
Output for 5.6.0 - 5.6.30
hi Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 130968 bytes) in /in/v27Ed on line 17
Process exited with code 255.