3v4l.org

run code in 300+ PHP versions simultaneously
<?php $notifications = array(); function add($type){ $notify = array( 'text' => '11' , 'link' => '22' ); if ( $notifications && count($notifications[$type]) <= 4 && count($notifications[$type]) ) { array_unshift($notifications[$type], $notify); } elseif ( $notifications && count($notifications[$type]) > 4 ) { array_pop($notifications[$type]); array_unshift($notifications[$type], $notify); } else { $notifications[$type] = []; array_unshift($notifications[$type], $notify); } } for($i = 0; $i< 2; $i++){ add($i); var_dump($notifications); }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $notifications in /in/JUbOO on line 10 Warning: Undefined variable $notifications in /in/JUbOO on line 15 array(0) { } Warning: Undefined variable $notifications in /in/JUbOO on line 10 Warning: Undefined variable $notifications in /in/JUbOO on line 15 array(0) { }

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.67 ms | 402 KiB | 8 Q