3v4l.org

run code in 300+ PHP versions simultaneously
<?php //initialization of an element of GLOBALS $GLOBALS['categories'] = array(1=>'z',2=>'x',3=>'c',4=>'v',5=>'r'); print_r($GLOBALS['categories']); //another element $GLOBALS['videos'] = array(1=>'a',2=>'b',3=>'c',4=>'d'); //some operations $videosCategories = array(1=>array(2,3,4,5),2=>array(12,13,14,15),3=>array(22,23,24,25),4=>array(32,33,34,35)); foreach($videosCategories as $videoId => $categories2) $GLOBALS['videos'][$videoId]['category'] = implode(',',$categories2); //the initial element is reqritten print_r($GLOBALS['categories']);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [1] => z [2] => x [3] => c [4] => v [5] => r ) Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /in/s7T2o:15 Stack trace: #0 {main} thrown in /in/s7T2o on line 15
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:
127.21 ms | 405 KiB | 5 Q