3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { static public function StaticRawr($name); { echo 'Rawr from static!'; if (!empty($name)) echo $name; } public $name = ''; public function Rawr() { echo 'Rawr! ' . $this->name; call_user_func(['self', 'StaticRawr'], $this->name); } } $rawrStatic = ['Test', 'StaticRawr']; $rawrStatic(); $testObj = new Test; $testObj->name = 'Вася'; $rawrObj = [$testObj, 'Rawr']; $rawrObj();
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.28
Fatal error: Non-abstract method Test::StaticRawr() must contain body in /in/AYcAV on line 5
Process exited with code 255.

preferences:
183.17 ms | 1395 KiB | 65 Q