3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1,2,3,4]; $m = []; $b = array_walk($a,function($c){ static $m; global $m; $m = array_push($m,$c); }); var_dump($m);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_push(): Argument #1 ($array) must be of type array, int given in /in/v95To:7 Stack trace: #0 /in/v95To(7): array_push(1, 2) #1 [internal function]: {closure}(2, 1) #2 /in/v95To(4): array_walk(Array, Object(Closure)) #3 {main} thrown in /in/v95To on line 7
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:
73.04 ms | 401 KiB | 8 Q