3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('in_array')) { function in_array($needle, $haystack, $strict = false) { while(list($key, $item) = each($haystack)) { if ($strict && $needle === $item) { return true; } else if($needle == $item) { return true; } } return false; } } var_dump(in_array(3, array(1,2,'3')));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/TJGFO
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'in_array'
          2        DO_ICALL                                         $0      
          3        BOOL_NOT                                         ~1      $0
          4      > JMPZ                                                     ~1, ->6
    5     5    >   DECLARE_FUNCTION                                         'in_array'
   17     6    >   INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'in_array'
          8        SEND_VAL                                                 3
          9        SEND_VAL                                                 <array>
         10        DO_ICALL                                         $2      
         11        SEND_VAR                                                 $2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00in_array%2Fin%2FTJGFO%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 4
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 7
filename:       /in/TJGFO
function name:  in_array
number of ops:  23
compiled vars:  !0 = $needle, !1 = $haystack, !2 = $strict, !3 = $item, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <false>
    6     3      > JMP                                                      ->13
    7     4    > > JMPZ_EX                                          ~5      !2, ->7
          5    >   IS_IDENTICAL                                     ~6      !0, !3
          6        BOOL                                             ~5      ~6
          7    > > JMPZ                                                     ~5, ->10
    8     8    > > RETURN                                                   <true>
          9*       JMP                                                      ->13
    9    10    >   IS_EQUAL                                                 !0, !3
         11      > JMPZ                                                     ~7, ->13
   10    12    > > RETURN                                                   <true>
    6    13    >   INIT_FCALL_BY_NAME                                       'each'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $8      
         16        FETCH_LIST_R                                     $9      $8, 0
         17        ASSIGN                                                   !4, $9
         18        FETCH_LIST_R                                     $11     $8, 1
         19        ASSIGN                                                   !3, $11
         20      > JMPNZ                                                    $8, ->4
   13    21    > > RETURN                                                   <false>
   14    22*     > RETURN                                                   null

End of function %00in_array%2Fin%2FTJGFO%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.83 ms | 1400 KiB | 19 Q