3v4l.org

run code in 300+ PHP versions simultaneously
<?php function WTF($arg) { // Payload: count the number of its own calls global $c; ++$c; // payload could be anything // use global to extract values global $collection; if (!isset($collection)) { $collection = []; } $collection[] = $arg; // also possible // $r = __FUNCTION__; // return $r(...) return __FUNCTION__; } WTF(1)(2)(4)(8)(16); echo "WTF was called $c times\n"; print_r($collection); ?>
Output for git.master, git.master_jit
WTF was called 5 times Array ( [0] => 1 [1] => 2 [2] => 4 [3] => 8 [4] => 16 )

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:
50.49 ms | 853 KiB | 4 Q