3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Sheet; $base = [1,2,3]; class Reader { public static function get($pos) { //GLOBAL $base; foreach ($base as $idx => $val) { if ($pos == ($idx +1)) return $base[$idx]; } return null; } } print \Sheet\Reader::get(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8b259
function name:  (null)
number of ops:  6
compiled vars:  !0 = $base
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_STATIC_METHOD_CALL                                  'Sheet%5CReader', 'get'
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Class Sheet\Reader:
Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/8b259
function name:  get
number of ops:  14
compiled vars:  !0 = $pos, !1 = $base, !2 = $val, !3 = $idx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1      > FE_RESET_R                                       $4      !1, ->11
          2    > > FE_FETCH_R                                       ~5      $4, !2, ->11
          3    >   ASSIGN                                                   !3, ~5
    8     4        ADD                                              ~7      !3, 1
          5        IS_EQUAL                                                 !0, ~7
          6      > JMPZ                                                     ~8, ->10
          7    >   FETCH_DIM_R                                      ~9      !1, !3
          8        FE_FREE                                                  $4
          9      > RETURN                                                   ~9
    7    10    > > JMP                                                      ->2
         11    >   FE_FREE                                                  $4
   10    12      > RETURN                                                   null
   11    13*     > RETURN                                                   null

End of function get

End of class Sheet\Reader.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.75 ms | 1394 KiB | 13 Q