3v4l.org

run code in 300+ PHP versions simultaneously
<?php $eggCount = 3; for($i = 1; $i <= $eggCount; $i++) { create("eggs", array($i => array("ID" => $i))); } function create($arrName, Array $arrKeys) { $lName = "$".strtolower($arrName); $$lName = array(); foreach($arrKeys as $key => $value) { $$lName[$key] = array(); $$lName[$key] = $value; print_r($$lName[0][ID]); } for($i = 1; $i <= $GLOBALS['eggCount']; $i++) { //echo "Egg $i's ID: " . $$lName[$i]; } print_r($$lName); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "ID" in /in/b9VBl:14 Stack trace: #0 /in/b9VBl(6): create('eggs', Array) #1 {main} thrown in /in/b9VBl on line 14
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:
45.95 ms | 401 KiB | 8 Q