3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr_input = array(); $arr_input[1] = array("parent"=>"null", "name"=>"one"); $arr_input[2] = array("parent"=>"1", "name"=>"two"); $arr_input[3] = array("parent"=>"null", "name"=>"three"); $arr_input[4] = array("parent"=>"3", "name"=>"four"); $arr_input[5] = array("parent"=>"4", "name"=>"five"); $arr_input[6] = array("parent"=>"2", "name"=>"six"); $arr_input[7] = array("parent"=>"3", "name"=>"seven"); $arr_input[8] = array("parent"=>"2", "name"=>"eight"); $input_id = 6; // variable input echo "check;"; if(isset($arr_input[$input_id])) { echo "yes"; echo $arr_input[$input_id]['name']; $parent_id = $arr_input[$input_id]['parent']; while($parent_id!='null') { if(isset($arr_input[$parent_id])) { echo "/".$arr_input[$parent_id]['name']; } $parent_id = $arr_input[$parent_id]['parent_id']; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 40
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 29
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 29
Branch analysis from position: 40
Branch analysis from position: 29
Branch analysis from position: 35
Branch analysis from position: 40
filename:       /in/LijSd
function name:  (null)
number of ops:  41
compiled vars:  !0 = $arr_input, !1 = $input_id, !2 = $parent_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0, 1
          2        OP_DATA                                                  <array>
    5     3        ASSIGN_DIM                                               !0, 2
          4        OP_DATA                                                  <array>
    6     5        ASSIGN_DIM                                               !0, 3
          6        OP_DATA                                                  <array>
    7     7        ASSIGN_DIM                                               !0, 4
          8        OP_DATA                                                  <array>
    8     9        ASSIGN_DIM                                               !0, 5
         10        OP_DATA                                                  <array>
    9    11        ASSIGN_DIM                                               !0, 6
         12        OP_DATA                                                  <array>
   10    13        ASSIGN_DIM                                               !0, 7
         14        OP_DATA                                                  <array>
   11    15        ASSIGN_DIM                                               !0, 8
         16        OP_DATA                                                  <array>
   13    17        ASSIGN                                                   !1, 6
   14    18        ECHO                                                     'check%3B'
   15    19        ISSET_ISEMPTY_DIM_OBJ                         0          !0, !1
         20      > JMPZ                                                     ~13, ->40
   17    21    >   ECHO                                                     'yes'
   18    22        FETCH_DIM_R                                      ~14     !0, !1
         23        FETCH_DIM_R                                      ~15     ~14, 'name'
         24        ECHO                                                     ~15
   19    25        FETCH_DIM_R                                      ~16     !0, !1
         26        FETCH_DIM_R                                      ~17     ~16, 'parent'
         27        ASSIGN                                                   !2, ~17
   20    28      > JMP                                                      ->38
   22    29    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, !2
         30      > JMPZ                                                     ~19, ->35
   24    31    >   FETCH_DIM_R                                      ~20     !0, !2
         32        FETCH_DIM_R                                      ~21     ~20, 'name'
         33        CONCAT                                           ~22     '%2F', ~21
         34        ECHO                                                     ~22
   26    35    >   FETCH_DIM_R                                      ~23     !0, !2
         36        FETCH_DIM_R                                      ~24     ~23, 'parent_id'
         37        ASSIGN                                                   !2, ~24
   20    38    >   IS_NOT_EQUAL                                             !2, 'null'
         39      > JMPNZ                                                    ~26, ->29
   28    40    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.99 ms | 1399 KiB | 13 Q