3v4l.org

run code in 300+ PHP versions simultaneously
<?php $superheroes = array( "spider_man" => array( "name" => "Peter Parker", "email" => "peterparker@mail.com", ), "super_man" => array( "name" => "Clark Kent", "email" => "clarkkent@mail.com", ), "iron_man" => array( "name" => "Harry Potter", "email" => "harrypotter@mail.com", "nicknames" => array( "name1" => "HP", "array" => array ( "arrayValue" => "value1", ), "name2" => "Potter", ), "test" => array( "test1" => "test1text", ), ) ); define(superheroes_spider_man_name, 1232); //print_r($superheroes); function setVariables_fromArray($array, $name) { forEach($array as $index => $item) { if(is_Array($item)) { $nameAltered = $name . "_" . $index; //funcIPSLog(("=========="), ("=========="), $enableIPSLog); //funcIPSLog(("ARRAY HEAD"), ($nameAltered), $enableIPSLog); echo "==========\n"; echo "ARRAY HEAD: '$nameAltered' \n"; setVariables_fromArray($item, $nameAltered); } else { //funcIPSLog(("VARIABLE: " . $nameVariable), ("Value: " . $item), $enableIPSLog); $nameVariable = $name . "_" . $index; echo "VARIABLE: '$nameVariable' VALUE: '$item' \n"; if(isset (${$nameVariable})) { //SetValueFloat(${$nameVariable}, $item); echo "SET: Die Variable '$nameVariable' mit dem Wert '$item' wurde gesetzt. \n"; } else { //funcIPSLog(("!!Meldung NetAtmo:"), ("Die Variable " . $nameVariable . " mit dem Wert " . $item . " ist nicht konfiguriert."), $enableIPSLog); echo "!! NetAtmo MELDUNG: Die Variable '$nameVariable' mit dem Wert '$item' ist nicht konfiguriert. \n"; } } } } setVariables_fromArray($superheroes, "superheroes");
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "superheroes_spider_man_name" in /in/Uh1C8:27 Stack trace: #0 {main} thrown in /in/Uh1C8 on line 27
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:
44.02 ms | 401 KiB | 8 Q