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", ) ); //print_r($superheroes); function checkArray($array, $dimensionName) { forEach($array as $index => $item) { $dimensionName = $dimensionName . "_" . $index; //$dimensionPath = $array . $index; if(is_Array($item)) { echo "========== \n"; //$dimensionPath = $array . $index; echo "YES1-" . $dimensionName . ": " . $item . "\n"; checkArray($item, $dimensionName); } else { echo "NO2-" . $dimensionName . ": " . $item . "\n"; } } } checkArray($superheroes);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SE11v
function name:  (null)
number of ops:  5
compiled vars:  !0 = $superheroes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   35     1        INIT_FCALL                                               'checkarray'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function checkarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/SE11v
function name:  checkArray
number of ops:  29
compiled vars:  !0 = $array, !1 = $dimensionName, !2 = $item, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2      > FE_RESET_R                                       $4      !0, ->27
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->27
          4    >   ASSIGN                                                   !3, ~5
   21     5        CONCAT                                           ~7      !1, '_'
          6        CONCAT                                           ~8      ~7, !3
          7        ASSIGN                                                   !1, ~8
   23     8        TYPE_CHECK                                  128          !2
          9      > JMPZ                                                     ~10, ->21
   24    10    >   ECHO                                                     '%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D+%0A'
   26    11        CONCAT                                           ~11     'YES1-', !1
         12        CONCAT                                           ~12     ~11, '%3A+'
         13        CONCAT                                           ~13     ~12, !2
         14        CONCAT                                           ~14     ~13, '%0A'
         15        ECHO                                                     ~14
   27    16        INIT_FCALL_BY_NAME                                       'checkArray'
         17        SEND_VAR_EX                                              !2
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
         20      > JMP                                                      ->26
   30    21    >   CONCAT                                           ~16     'NO2-', !1
         22        CONCAT                                           ~17     ~16, '%3A+'
         23        CONCAT                                           ~18     ~17, !2
         24        CONCAT                                           ~19     ~18, '%0A'
         25        ECHO                                                     ~19
   20    26    > > JMP                                                      ->3
         27    >   FE_FREE                                                  $4
   33    28      > RETURN                                                   null

End of function checkarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.95 ms | 1403 KiB | 14 Q