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 git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Test::StaticRawr(), 0 passed in /in/2d9Qr on line 20 and exactly 1 expected in /in/2d9Qr:5 Stack trace: #0 /in/2d9Qr(20): Test::StaticRawr() #1 {main} thrown in /in/2d9Qr on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.38 ms | 401 KiB | 8 Q