3v4l.org

run code in 500+ PHP versions simultaneously
<?php $selectors = array('plants', 'fruits', 'apple'); $list = array( 'plants' => array( 'fruits' => array( 'apple' => 'sweet', 'orange' => 'sweet', 'pear' => 'tart' ) ) ); $select = $list; foreach ($selectors as $selector) { if (isset($select[$selector])) { $select = $select[$selector]; } else { exit("Error: '$selector' not found"); } } echo $select;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/4KYiP
function name:  (null)
number of ops:  20
compiled vars:  !0 = $selectors, !1 = $list, !2 = $select, !3 = $selector
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        ASSIGN                                                       !1, <array>
   15     2        ASSIGN                                                       !2, !1
   16     3      > FE_RESET_R                                           $7      !0, ->17
          4    > > FE_FETCH_R                                                   $7, !3, ->17
   17     5    >   ISSET_ISEMPTY_DIM_OBJ                             0          !2, !3
          6      > JMPZ                                                         ~8, ->10
   18     7    >   FETCH_DIM_R                                          ~9      !2, !3
          8        ASSIGN                                                       !2, ~9
   17     9      > JMP                                                          ->16
   20    10    > > INIT_FCALL                                                   'exit'
         11*       ROPE_INIT                                         3  ~12     'Error%3A+%27'
         12*       ROPE_ADD                                          1  ~12     ~12, !3
         13*       ROPE_END                                          2  ~11     ~12, '%27+not+found'
         14*       SEND_VAL                                                     ~11
         15*       DO_ICALL                                                     
   16    16    > > JMP                                                          ->4
         17    >   FE_FREE                                                      $7
   24    18        ECHO                                                         !2
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
267.51 ms | 2616 KiB | 15 Q