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");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uh1C8
function name:  (null)
number of ops:  11
compiled vars:  !0 = $superheroes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   27     1        INIT_FCALL                                               'define'
          2        FETCH_CONSTANT                                   ~2      'superheroes_spider_man_name'
          3        SEND_VAL                                                 ~2
          4        SEND_VAL                                                 1232
          5        DO_ICALL                                                 
   57     6        INIT_FCALL                                               'setvariables_fromarray'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'superheroes'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function setvariables_fromarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 45
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 45
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
filename:       /in/Uh1C8
function name:  setVariables_fromArray
number of ops:  47
compiled vars:  !0 = $array, !1 = $name, !2 = $item, !3 = $index, !4 = $nameAltered, !5 = $nameVariable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   32     2      > FE_RESET_R                                       $6      !0, ->45
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->45
          4    >   ASSIGN                                                   !3, ~7
   33     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~9, ->20
   34     7    >   CONCAT                                           ~10     !1, '_'
          8        CONCAT                                           ~11     ~10, !3
          9        ASSIGN                                                   !4, ~11
   37    10        ECHO                                                     '%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A'
   38    11        ROPE_INIT                                     3  ~14     'ARRAY+HEAD%3A+%27'
         12        ROPE_ADD                                      1  ~14     ~14, !4
         13        ROPE_END                                      2  ~13     ~14, '%27+%0A'
         14        ECHO                                                     ~13
   39    15        INIT_FCALL_BY_NAME                                       'setVariables_fromArray'
         16        SEND_VAR_EX                                              !2
         17        SEND_VAR_EX                                              !4
         18        DO_FCALL                                      0          
         19      > JMP                                                      ->44
   43    20    >   CONCAT                                           ~17     !1, '_'
         21        CONCAT                                           ~18     ~17, !3
         22        ASSIGN                                                   !5, ~18
   44    23        ROPE_INIT                                     5  ~21     'VARIABLE%3A+%27'
         24        ROPE_ADD                                      1  ~21     ~21, !5
         25        ROPE_ADD                                      2  ~21     ~21, '%27+VALUE%3A+%27'
         26        ROPE_ADD                                      3  ~21     ~21, !2
         27        ROPE_END                                      4  ~20     ~21, '%27+%0A'
         28        ECHO                                                     ~20
   45    29        ISSET_ISEMPTY_VAR                             4          !5
         30      > JMPZ                                                     ~24, ->38
   47    31    >   ROPE_INIT                                     5  ~26     'SET%3A+Die+Variable+%27'
         32        ROPE_ADD                                      1  ~26     ~26, !5
         33        ROPE_ADD                                      2  ~26     ~26, '%27+mit+dem+Wert+%27'
         34        ROPE_ADD                                      3  ~26     ~26, !2
         35        ROPE_END                                      4  ~25     ~26, '%27+wurde+gesetzt.+%0A'
         36        ECHO                                                     ~25
         37      > JMP                                                      ->44
   51    38    >   ROPE_INIT                                     5  ~30     '%21%21+NetAtmo+MELDUNG%3A+Die+Variable+%27'
         39        ROPE_ADD                                      1  ~30     ~30, !5
         40        ROPE_ADD                                      2  ~30     ~30, '%27+mit+dem+Wert+%27'
         41        ROPE_ADD                                      3  ~30     ~30, !2
         42        ROPE_END                                      4  ~29     ~30, '%27+ist+nicht+konfiguriert.+%0A'
         43        ECHO                                                     ~29
   32    44    > > JMP                                                      ->3
         45    >   FE_FREE                                                  $6
   55    46      > RETURN                                                   null

End of function setvariables_fromarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.21 ms | 1403 KiB | 16 Q