3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userAllowedString = "Sales Manager,Sales Director,Project Manager,Developer"; $userRole = "Sales Administrator"; $userAllowedString = explode(',', $userAllowedString); if(in_array($userRole, $userAllowedString)) { $userAllowed= 'true'; } else { $userAllowed = 'false'; } echo $userAllowed;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zkg9b
function name:  (null)
number of ops:  17
compiled vars:  !0 = $userAllowedString, !1 = $userRole, !2 = $userAllowed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Sales+Manager%2CSales+Director%2CProject+Manager%2CDeveloper'
    3     1        ASSIGN                                                   !1, 'Sales+Administrator'
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    6     7        INIT_FCALL                                               'in_array'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11      > JMPZ                                                     $7, ->14
    7    12    >   ASSIGN                                                   !2, 'true'
    6    13      > JMP                                                      ->15
    9    14    >   ASSIGN                                                   !2, 'false'
   11    15    >   ECHO                                                     !2
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.32 ms | 1011 KiB | 15 Q