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(array()); foreach($arrKeys as $key => $value) { $$lName[$key] = $value; } for($i = 1; $i <= $GLOBALS['eggCount']; $i++) { echo "Egg $i's ID: " . $$lName[$i]; } print_r($$lName[0]); }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/3kOKQ on line 16 Egg 1's ID: Array Warning: Undefined array key 2 in /in/3kOKQ on line 16 Egg 2's ID: Warning: Undefined array key 3 in /in/3kOKQ on line 16 Egg 3's ID: Array ( ) Warning: Undefined array key 1 in /in/3kOKQ on line 16 Egg 1's ID: Warning: Array to string conversion in /in/3kOKQ on line 16 Egg 2's ID: Array Warning: Undefined array key 3 in /in/3kOKQ on line 16 Egg 3's ID: Array ( ) Warning: Undefined array key 1 in /in/3kOKQ on line 16 Egg 1's ID: Warning: Undefined array key 2 in /in/3kOKQ on line 16 Egg 2's ID: Warning: Array to string conversion in /in/3kOKQ on line 16 Egg 3's ID: ArrayArray ( )

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:
43.45 ms | 402 KiB | 8 Q