3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(0,1,2,3,4,5,6,7,8,9); function getNum($arr, $value) { foreach($arr as $key => $val){ if($val == $value) return $val; } } echo getNum($arr, 5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u5bai
function name:  (null)
number of ops:  7
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'getnum'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 5
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function getnum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/u5bai
function name:  getNum
number of ops:  12
compiled vars:  !0 = $arr, !1 = $value, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2      > FE_RESET_R                                       $4      !0, ->10
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->10
          4    >   ASSIGN                                                   !3, ~5
    6     5        IS_EQUAL                                                 !2, !1
          6      > JMPZ                                                     ~7, ->9
    7     7    >   FE_FREE                                                  $4
          8      > RETURN                                                   !2
    5     9    > > JMP                                                      ->3
         10    >   FE_FREE                                                  $4
    9    11      > RETURN                                                   null

End of function getnum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.04 ms | 1398 KiB | 14 Q