3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Hook class file * * @category Include * @package Slimium\Module\Core * @author Jakub Ďuraš <jkblmr@gmail.com> */ /** * Hook class- class for working with hooks * * -100 - lowest priority <br> * 100+ - highest priority <br> * 50 - default priority <br> * if the priority is already taken, the nearest free lower one is taken */ class hook { /** * List of hooks * @var array */ private static $hooks = []; /** * Call hooks and don't pass any returned value * @param string $hook_enviroment can be module name or other enviroment in which hook is located * @param string $hook_name name * @param mixed $argument argument to pass to hook * @return boolean TRUE if there are any hooks assigned and they were executed, FALSE in there are no hooks assigned */ public static function call($hook_enviroment, $hook_name, $argument = NULL) { //If there is any hooked function if (isset(self::$hooks[$hook_enviroment][$hook_name])) { //Sort array krsort(self::$hooks[$hook_enviroment][$hook_name]); //Loop thorugh array foreach (self::$hooks[$hook_enviroment][$hook_name] as $hook_function) { $hook_function($argument); } return true; }else{ return false; } } /** * Call hooks, let argument go through filtering and return filtered argument * @param string $hook_enviroment can be module name or other enviroment in which hook is located * @param string $hook_name name * @param mixed $argument argument to pass to hook * @return mixed filtered argument */ public static function filter($hook_enviroment, $hook_name, $argument = NULL) { //If there is any hooked function if (isset(self::$hooks[$hook_enviroment][$hook_name])) { //Sort array krsort(self::$hooks[$hook_enviroment][$hook_name]); $filtered = $argument; $first = true; //Loop thorugh array foreach (self::$hooks[$hook_enviroment][$hook_name] as $hook_function) { if($first){ $filtered = $hook_function($argument); $first = false; }else{ $filtered = $hook_function($argument, $filtered); } } return $filtered; } } /** * Add hook * @param string $hook_enviroment can be module name or other enviroment in which hook is located * @param string $hook_name name * @param callable $function name of the function of anonymous function to call * @param callable $priority priority of the hook, can be anything from 1(executed as last) to 100+(executed as first) if priority is already taken, the nearest free lower one is taken * @return integer priority at which hook was added */ public static function add($hook_enviroment, $hook_name, $function, $priority = 50) { //If we do not need to loop through prirorities if(!isset(self::$hooks[$hook_enviroment][$hook_name][$priority])){ self::$hooks[$hook_enviroment][$hook_name][$priority] = $function; return $priority; } //Loop through hooked functions to find nearest free priority for ($priority; $priority > -100; $priority--) { if(!isset(self::$hooks[$hook_enviroment][$hook_name][$priority])){ self::$hooks[$hook_enviroment][$hook_name][$priority] = $function; break; } } return $priority; } /** * Remove hook at certain priority * @param string $hook_enviroment can be module name or other enviroment in which hook is located * @param string $hook_name name * @param callable $priority priority of the hook to delete * @return boolean TRUE */ public static function remove($hook_enviroment, $hook_name, $priority) { unset(self::$hooks[$hook_enviroment][$hook_name][$priority]); return true; } /** * Remove hook all hooks of some name and in som enviroment * @param string $hook_enviroment can be module name or other enviroment in which hook is located * @param string $hook_name name * @return boolean TRUE */ public static function remove_all($hook_enviroment, $hook_name) { self::$hooks[$hook_enviroment][$hook_name] = []; return true; } /** * Is anything hooked at certain priority * @param string $hook_enviroment can be module name or other enviroment in which hook is located * @param string $hook_name name * @param callable $priority priority of the hook * @return boolean TRUE or FALSE */ public static function is_hooked($hook_enviroment, $hook_name, $priority) { if(isset(self::$hooks[$hook_enviroment][$hook_name][$priority])){ return true; }else{ return false; } } } hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::add('main', 'init', function(){$var = 'foo';}); hook::call('main', 'init');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  (null)
number of ops:  65
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  154     0  E >   INIT_STATIC_METHOD_CALL                                  'hook', 'add'
          1        SEND_VAL                                                 'main'
          2        SEND_VAL                                                 'init'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A154%240'
          4        SEND_VAL                                                 ~0
          5        DO_FCALL                                      0          
  155     6        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
          7        SEND_VAL                                                 'main'
          8        SEND_VAL                                                 'init'
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A155%241'
         10        SEND_VAL                                                 ~2
         11        DO_FCALL                                      0          
  156    12        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         13        SEND_VAL                                                 'main'
         14        SEND_VAL                                                 'init'
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A156%242'
         16        SEND_VAL                                                 ~4
         17        DO_FCALL                                      0          
  157    18        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         19        SEND_VAL                                                 'main'
         20        SEND_VAL                                                 'init'
         21        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A157%243'
         22        SEND_VAL                                                 ~6
         23        DO_FCALL                                      0          
  158    24        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         25        SEND_VAL                                                 'main'
         26        SEND_VAL                                                 'init'
         27        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A158%244'
         28        SEND_VAL                                                 ~8
         29        DO_FCALL                                      0          
  159    30        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         31        SEND_VAL                                                 'main'
         32        SEND_VAL                                                 'init'
         33        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A159%245'
         34        SEND_VAL                                                 ~10
         35        DO_FCALL                                      0          
  160    36        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         37        SEND_VAL                                                 'main'
         38        SEND_VAL                                                 'init'
         39        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A160%246'
         40        SEND_VAL                                                 ~12
         41        DO_FCALL                                      0          
  161    42        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         43        SEND_VAL                                                 'main'
         44        SEND_VAL                                                 'init'
         45        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A161%247'
         46        SEND_VAL                                                 ~14
         47        DO_FCALL                                      0          
  162    48        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         49        SEND_VAL                                                 'main'
         50        SEND_VAL                                                 'init'
         51        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A162%248'
         52        SEND_VAL                                                 ~16
         53        DO_FCALL                                      0          
  163    54        INIT_STATIC_METHOD_CALL                                  'hook', 'add'
         55        SEND_VAL                                                 'main'
         56        SEND_VAL                                                 'init'
         57        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8pvFH%3A163%249'
         58        SEND_VAL                                                 ~18
         59        DO_FCALL                                      0          
  164    60        INIT_STATIC_METHOD_CALL                                  'hook', 'call'
         61        SEND_VAL                                                 'main'
         62        SEND_VAL                                                 'init'
         63        DO_FCALL                                      0          
         64      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A154%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  154     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A154%240

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A155%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  155     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A155%241

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A156%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  156     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A156%242

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A157%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  157     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A157%243

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A158%244:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  158     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A158%244

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A159%245:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  159     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A159%245

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A160%246:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  160     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A160%246

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A161%247:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  161     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A161%247

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A162%248:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  162     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A162%248

Function %00%7Bclosure%7D%2Fin%2F8pvFH%3A163%249:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  163     0  E >   ASSIGN                                                   !0, 'foo'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8pvFH%3A163%249

Class hook:
Function call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  call
number of ops:  27
compiled vars:  !0 = $hook_enviroment, !1 = $hook_name, !2 = $argument, !3 = $hook_function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   36     3        FETCH_STATIC_PROP_IS                             ~4      'hooks'
          4        FETCH_DIM_IS                                     ~5      ~4, !0
          5        ISSET_ISEMPTY_DIM_OBJ                         0          ~5, !1
          6      > JMPZ                                                     ~6, ->25
   38     7    >   INIT_FCALL                                               'krsort'
          8        FETCH_STATIC_PROP_W          unknown             $7      'hooks'
          9        FETCH_DIM_W                                      $8      $7, !0
         10        FETCH_DIM_W                                      $9      $8, !1
         11        SEND_REF                                                 $9
         12        DO_ICALL                                                 
   41    13        FETCH_STATIC_PROP_R          unknown             ~11     'hooks'
         14        FETCH_DIM_R                                      ~12     ~11, !0
         15        FETCH_DIM_R                                      ~13     ~12, !1
         16      > FE_RESET_R                                       $14     ~13, ->22
         17    > > FE_FETCH_R                                               $14, !3, ->22
   42    18    >   INIT_DYNAMIC_CALL                                        !3
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
   41    21      > JMP                                                      ->17
         22    >   FE_FREE                                                  $14
   45    23      > RETURN                                                   <true>
         24*       JMP                                                      ->26
   47    25    > > RETURN                                                   <false>
   49    26*     > RETURN                                                   null

End of function call

Function filter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 35
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 33
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 33
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 27
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  filter
number of ops:  36
compiled vars:  !0 = $hook_enviroment, !1 = $hook_name, !2 = $argument, !3 = $filtered, !4 = $first, !5 = $hook_function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   61     3        FETCH_STATIC_PROP_IS                             ~6      'hooks'
          4        FETCH_DIM_IS                                     ~7      ~6, !0
          5        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, !1
          6      > JMPZ                                                     ~8, ->35
   63     7    >   INIT_FCALL                                               'krsort'
          8        FETCH_STATIC_PROP_W          unknown             $9      'hooks'
          9        FETCH_DIM_W                                      $10     $9, !0
         10        FETCH_DIM_W                                      $11     $10, !1
         11        SEND_REF                                                 $11
         12        DO_ICALL                                                 
   65    13        ASSIGN                                                   !3, !2
   66    14        ASSIGN                                                   !4, <true>
   69    15        FETCH_STATIC_PROP_R          unknown             ~15     'hooks'
         16        FETCH_DIM_R                                      ~16     ~15, !0
         17        FETCH_DIM_R                                      ~17     ~16, !1
         18      > FE_RESET_R                                       $18     ~17, ->33
         19    > > FE_FETCH_R                                               $18, !5, ->33
   70    20    > > JMPZ                                                     !4, ->27
   71    21    >   INIT_DYNAMIC_CALL                                        !5
         22        SEND_VAR_EX                                              !2
         23        DO_FCALL                                      0  $19     
         24        ASSIGN                                                   !3, $19
   72    25        ASSIGN                                                   !4, <false>
         26      > JMP                                                      ->32
   74    27    >   INIT_DYNAMIC_CALL                                        !5
         28        SEND_VAR_EX                                              !2
         29        SEND_VAR_EX                                              !3
         30        DO_FCALL                                      0  $22     
         31        ASSIGN                                                   !3, $22
   69    32    > > JMP                                                      ->19
         33    >   FE_FREE                                                  $18
   78    34      > RETURN                                                   !3
   80    35    > > RETURN                                                   null

End of function filter

Function add:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 17
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 29
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 17
Branch analysis from position: 32
Branch analysis from position: 17
filename:       /in/8pvFH
function name:  add
number of ops:  34
compiled vars:  !0 = $hook_enviroment, !1 = $hook_name, !2 = $function, !3 = $priority
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   90     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      50
   93     4        FETCH_STATIC_PROP_IS                             ~4      'hooks'
          5        FETCH_DIM_IS                                     ~5      ~4, !0
          6        FETCH_DIM_IS                                     ~6      ~5, !1
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~7      ~6, !3
          8        BOOL_NOT                                         ~8      ~7
          9      > JMPZ                                                     ~8, ->16
   94    10    >   FETCH_STATIC_PROP_W          unknown             $9      'hooks'
         11        FETCH_DIM_W                                      $10     $9, !0
         12        FETCH_DIM_W                                      $11     $10, !1
         13        ASSIGN_DIM                                               $11, !3
         14        OP_DATA                                                  !2
   95    15      > RETURN                                                   !3
   99    16    > > JMP                                                      ->30
  101    17    >   FETCH_STATIC_PROP_IS                             ~13     'hooks'
         18        FETCH_DIM_IS                                     ~14     ~13, !0
         19        FETCH_DIM_IS                                     ~15     ~14, !1
         20        ISSET_ISEMPTY_DIM_OBJ                         0  ~16     ~15, !3
         21        BOOL_NOT                                         ~17     ~16
         22      > JMPZ                                                     ~17, ->29
  102    23    >   FETCH_STATIC_PROP_W          unknown             $18     'hooks'
         24        FETCH_DIM_W                                      $19     $18, !0
         25        FETCH_DIM_W                                      $20     $19, !1
         26        ASSIGN_DIM                                               $20, !3
         27        OP_DATA                                                  !2
  103    28      > JMP                                                      ->32
   99    29    >   PRE_DEC                                                  !3
         30    >   IS_SMALLER                                               -100, !3
         31      > JMPNZ                                                    ~23, ->17
  108    32    > > RETURN                                                   !3
  109    33*     > RETURN                                                   null

End of function add

Function remove:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  remove
number of ops:  9
compiled vars:  !0 = $hook_enviroment, !1 = $hook_name, !2 = $priority
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  118     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
  120     3        FETCH_STATIC_PROP_UNSET                          $3      'hooks'
          4        FETCH_DIM_UNSET                                  $4      $3, !0
          5        FETCH_DIM_UNSET                                  $5      $4, !1
          6        UNSET_DIM                                                $5, !2
  122     7      > RETURN                                                   <true>
  123     8*     > RETURN                                                   null

End of function remove

Function remove_all:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  remove_all
number of ops:  8
compiled vars:  !0 = $hook_enviroment, !1 = $hook_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  131     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  133     2        FETCH_STATIC_PROP_W          global              $2      'hooks'
          3        FETCH_DIM_W                                      $3      $2, !0
          4        ASSIGN_DIM                                               $3, !1
          5        OP_DATA                                                  <array>
  135     6      > RETURN                                                   <true>
  136     7*     > RETURN                                                   null

End of function remove_all

Function is_hooked:
Finding entry points
Branch analysis from position: 0
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pvFH
function name:  is_hooked
number of ops:  12
compiled vars:  !0 = $hook_enviroment, !1 = $hook_name, !2 = $priority
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  145     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
  147     3        FETCH_STATIC_PROP_IS                             ~3      'hooks'
          4        FETCH_DIM_IS                                     ~4      ~3, !0
          5        FETCH_DIM_IS                                     ~5      ~4, !1
          6        ISSET_ISEMPTY_DIM_OBJ                         0          ~5, !2
          7      > JMPZ                                                     ~6, ->10
  148     8    > > RETURN                                                   <true>
          9*       JMP                                                      ->11
  150    10    > > RETURN                                                   <false>
  152    11*     > RETURN                                                   null

End of function is_hooked

End of class hook.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.57 ms | 1420 KiB | 15 Q