3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roleDFSOnePrivilege(Role\RoleInterface $role, Resource\ResourceInterface $resource = null, $privilege = null) { if (null === $privilege) { throw new Exception\RuntimeException('$privilege parameter may not be null'); } $dfs = array( 'visited' => array(), 'stack' => array() ); if (null !== ($result = roleDFSVisitOnePrivilege($role, $resource, $privilege, $dfs))) { return $result; } // This comment is needed due to a strange php-cs-fixer bug while (null !== ($role = array_pop($dfs['stack']))) { if (!isset($dfs['visited'][$role->getRoleId()])) { if (null !== ($result = $roleDFSVisitOnePrivilege($role, $resource, $privilege, $dfs))) { return $result; } } } return null; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lMQ7r
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   1

Function roledfsoneprivilege:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 21
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 37
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 37
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 37
filename:       /in/lMQ7r
function name:  roleDFSOnePrivilege
number of ops:  46
compiled vars:  !0 = $role, !1 = $resource, !2 = $privilege, !3 = $dfs, !4 = $result, !5 = $roleDFSVisitOnePrivilege
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
    5     3        TYPE_CHECK                                    2          !2
          4      > JMPZ                                                     ~6, ->9
    6     5    >   NEW                                              $7      'Exception%5CRuntimeException'
          6        SEND_VAL_EX                                              '%24privilege+parameter+may+not+be+null'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $7
    9     9    >   ASSIGN                                                   !3, <array>
   14    10        INIT_FCALL_BY_NAME                                       'roleDFSVisitOnePrivilege'
         11        SEND_VAR_EX                                              !0
         12        SEND_VAR_EX                                              !1
         13        SEND_VAR_EX                                              !2
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0  $10     
         16        ASSIGN                                           ~11     !4, $10
         17        TYPE_CHECK                                  1020          ~11
         18      > JMPZ                                                     ~12, ->20
   15    19    > > RETURN                                                   !4
   19    20    > > JMP                                                      ->37
   20    21    >   INIT_METHOD_CALL                                         !0, 'getRoleId'
         22        DO_FCALL                                      0  $14     
         23        FETCH_DIM_IS                                     ~13     !3, 'visited'
         24        ISSET_ISEMPTY_DIM_OBJ                         0  ~15     ~13, $14
         25        BOOL_NOT                                         ~16     ~15
         26      > JMPZ                                                     ~16, ->37
   21    27    >   INIT_DYNAMIC_CALL                                        !5
         28        SEND_VAR_EX                                              !0
         29        SEND_VAR_EX                                              !1
         30        SEND_VAR_EX                                              !2
         31        SEND_VAR_EX                                              !3
         32        DO_FCALL                                      0  $17     
         33        ASSIGN                                           ~18     !4, $17
         34        TYPE_CHECK                                  1020          ~18
         35      > JMPZ                                                     ~19, ->37
   22    36    > > RETURN                                                   !4
   19    37    >   INIT_FCALL                                               'array_pop'
         38        FETCH_DIM_W                                      $20     !3, 'stack'
         39        SEND_REF                                                 $20
         40        DO_ICALL                                         $21     
         41        ASSIGN                                           ~22     !0, $21
         42        TYPE_CHECK                                  1020          ~22
         43      > JMPNZ                                                    ~23, ->21
   27    44    > > RETURN                                                   null
   28    45*     > RETURN                                                   null

End of function roledfsoneprivilege

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.79 ms | 1400 KiB | 15 Q