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 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 = 20, Position 2 = 39
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 28
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 34
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 28
Branch analysis from position: 39
Branch analysis from position: 28
Branch analysis from position: 34
Branch analysis from position: 39
filename:       /in/MUrCc
function name:  (null)
number of ops:  40
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
   15    18        ISSET_ISEMPTY_DIM_OBJ                         0          !0, !1
         19      > JMPZ                                                     ~13, ->39
   17    20    >   ECHO                                                     'yes'
   18    21        FETCH_DIM_R                                      ~14     !0, !1
         22        FETCH_DIM_R                                      ~15     ~14, 'name'
         23        ECHO                                                     ~15
   19    24        FETCH_DIM_R                                      ~16     !0, !1
         25        FETCH_DIM_R                                      ~17     ~16, 'parent'
         26        ASSIGN                                                   !2, ~17
   20    27      > JMP                                                      ->37
   22    28    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, !2
         29      > JMPZ                                                     ~19, ->34
   24    30    >   FETCH_DIM_R                                      ~20     !0, !2
         31        FETCH_DIM_R                                      ~21     ~20, 'name'
         32        CONCAT                                           ~22     '%2F', ~21
         33        ECHO                                                     ~22
   26    34    >   FETCH_DIM_R                                      ~23     !0, !2
         35        FETCH_DIM_R                                      ~24     ~23, 'parent_id'
         36        ASSIGN                                                   !2, ~24
   20    37    >   IS_NOT_EQUAL                                             !2, 'null'
         38      > JMPNZ                                                    ~26, ->28
   28    39    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.46 ms | 1399 KiB | 13 Q