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

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:
53.79 ms | 408 KiB | 8 Q