3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("superheroes_spider-man_name", 123456); define("enableIPSLogList", false); //IPSLog mit Liste aller Variablen define("enableIPSLogSet", false); //IPSLog mit Liste aller Variablen die gesetzt wurden define("enableIPSLogMissing", false); //IPSLog mit Liste aller nicht konfigurierten Variablen define("enableEchoList", false); //IPSLog mit Liste aller Variablen define("enableEchoSet", false); //IPSLog mit Liste aller Variablen die gesetzt wurden define("enableEchoMissing", false); //IPSLog mit Liste aller nicht konfigurierten Variablen $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", "name2" => "Potter", ), "test" => array( "test1" => "test1text", ), ) ); //print_r($superheroes); //Funktion zur Ausgabe von IPSLogs //funcIPSLog(("SENDER"), ("REPORT"), $enableIPSLog); //funcIPSLog(("SENDER"), ("REPORT"), $enableIPSLogMissing); function funcIPSLog($sender, $report, $check) { if($check) { IPS_LogMessage($sender, $report); } } //funcEcho(("MESSAGE"), $enableEchoMissing); function funcEcho($message, $check) { if($check) { echo ($message); } } //setVariables_fromArray($array, "prefix"); function setVariables_fromArray($array, $name) { forEach($array as $index => $item) { if(is_Array($item)) { $nameAltered = $name . "_" . $index; funcIPSLog(("=========="), ("=========="), enableIPSLog); funcIPSLog(("ARRAY HEAD"), ($nameAltered), enableIPSLog); funcEcho(("==========\n"), enableEchoLog); funcEcho(("ARRAY HEAD: '$nameAltered' \n"), enableEchoLog); setVariables_fromArray($item, $nameAltered); } else { $nameVariable = $name . "_" . $index; //funcIPSLog(("VARIABLE: " . $nameVariable), ("Value: " . $item), enableIPSLogList); funcEcho(("VARIABLE: '$nameVariable' VALUE: '$item' \n"), enableEchoList); if(defined($nameVariable)) { //SetValueFloat(${$nameVariable}, $item); funcIPSLog(("SET: "), ("Die Variable '$nameVariable' mit dem Wert '$item' wurde gesetzt. \n"), enableIPSLogSet); funcEcho(("SET: Die Variable '$nameVariable' mit dem Wert '$item' wurde gesetzt. \n"), enableEchoSet); } else { funcIPSLog(("!!Meldung NetAtmo:"), ("Die Variable " . $nameVariable . " mit dem Wert " . $item . " ist nicht konfiguriert."), enableIPSLogMissing); funcEcho(("!! NetAtmo MELDUNG: Die Variable '$nameVariable' mit dem Wert '$item' ist nicht konfiguriert. \n"), enableEchoMissing); } } } } setVariables_fromArray($superheroes, "superheroes"); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught Error: Undefined constant "enableIPSLog" in /in/ZRPs5:60 Stack trace: #0 /in/ZRPs5(83): setVariables_fromArray(Array, 'superheroes') #1 {main} thrown in /in/ZRPs5 on line 60
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant enableIPSLog - assumed 'enableIPSLog' (this will throw an Error in a future version of PHP) in /in/ZRPs5 on line 60 Fatal error: Uncaught Error: Call to undefined function IPS_LogMessage() in /in/ZRPs5:43 Stack trace: #0 /in/ZRPs5(60): funcIPSLog('==========', '==========', 'enableIPSLog') #1 /in/ZRPs5(83): setVariables_fromArray(Array, 'superheroes') #2 {main} thrown in /in/ZRPs5 on line 43
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25
Notice: Use of undefined constant enableIPSLog - assumed 'enableIPSLog' in /in/ZRPs5 on line 60 Fatal error: Uncaught Error: Call to undefined function IPS_LogMessage() in /in/ZRPs5:43 Stack trace: #0 /in/ZRPs5(60): funcIPSLog('==========', '==========', 'enableIPSLog') #1 /in/ZRPs5(83): setVariables_fromArray(Array, 'superheroes') #2 {main} thrown in /in/ZRPs5 on line 43
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Notice: Use of undefined constant enableIPSLog - assumed 'enableIPSLog' in /in/ZRPs5 on line 60 Fatal error: Call to undefined function IPS_LogMessage() in /in/ZRPs5 on line 43
Process exited with code 255.

preferences:
164.93 ms | 402 KiB | 199 Q