3v4l.org

run code in 300+ PHP versions simultaneously
<?php $role = 2; $role_id = array (array('role_id' => 2 ), array('role_id' => 1 ) ); if (in_array($role, array_column($role_id, 'role_id'))) { echo "Match found"; } else { echo "Match not found"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b3eEJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $role, !1 = $role_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 'role_id'
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
         10      > JMPZ                                                     $5, ->13
    6    11    >   ECHO                                                     'Match+found'
    5    12      > JMP                                                      ->14
    9    13    >   ECHO                                                     'Match+not+found'
   10    14    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.19 ms | 1002 KiB | 15 Q