3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Randoz{ public function between0And10():int { return rand(0,10); } } interface RndCounter { function randomInt():int; function between0And10():int; } function create(): RndCounter { return new class() implements RndCounter { use Randoz; function randomInt():int { return rand(); } }; } $counter = create(); echo $counter->randomInt()." - ".$counter->between0And10();
Output for git.master
1041138631 - 2
Output for git.master_jit
668223632 - 9

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:
35.3 ms | 401 KiB | 7 Q