3v4l.org

run code in 300+ PHP versions simultaneously
<?php function c_in_array($needle, $haystack){ if(!is_array($haystack)){ return false; } foreach($haystack as $index => $value){ if(is_array($value)){ return c_in_array($needle, $value); }else{ if($needle == $value){ return true; } } } return false; } $array = []; $array[] = ['content' => '192.168.178.1', 'disabled' => true]; $array[] = ['content' => '192.168.178.2', 'disabled' => false]; var_dump($array, c_in_array('192.168.178.4', $array)); //var_dump($array, array_search('192.168.178.2', $array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sRNGb
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, <array>
   21     1        ASSIGN_DIM                                               !0
          2        OP_DATA                                                  <array>
   22     3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  <array>
   24     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        INIT_FCALL                                               'c_in_array'
          8        SEND_VAL                                                 '192.168.178.4'
          9        SEND_VAR                                                 !0
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
   25    13      > RETURN                                                   1

Function c_in_array:
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
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/sRNGb
function name:  c_in_array
number of ops:  26
compiled vars:  !0 = $needle, !1 = $haystack, !2 = $value, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        TYPE_CHECK                                  128  ~4      !1
          3        BOOL_NOT                                         ~5      ~4
          4      > JMPZ                                                     ~5, ->6
    4     5    > > RETURN                                                   <false>
    7     6    > > FE_RESET_R                                       $6      !1, ->23
          7    > > FE_FETCH_R                                       ~7      $6, !2, ->23
          8    >   ASSIGN                                                   !3, ~7
    8     9        TYPE_CHECK                                  128          !2
         10      > JMPZ                                                     ~9, ->18
    9    11    >   INIT_FCALL_BY_NAME                                       'c_in_array'
         12        SEND_VAR_EX                                              !0
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0  $10     
         15        FE_FREE                                                  $6
         16      > RETURN                                                   $10
         17*       JMP                                                      ->22
   11    18    >   IS_EQUAL                                                 !0, !2
         19      > JMPZ                                                     ~11, ->22
   12    20    >   FE_FREE                                                  $6
         21      > RETURN                                                   <true>
    7    22    > > JMP                                                      ->7
         23    >   FE_FREE                                                  $6
   17    24      > RETURN                                                   <false>
   18    25*     > RETURN                                                   null

End of function c_in_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.9 ms | 1403 KiB | 16 Q