3v4l.org

run code in 300+ PHP versions simultaneously
<?php function event($name,$cb = null){ static $e = array(); if ( is_callable($cb) ){ empty( $e[$name] ) ? $e[$name] = array($cb) : $e[$name][] = $cb; } elseif ( false === empty($e[$name]) ) { $a = is_array($cb) ? $cb : array(); foreach ($e[$name] as $eh) call_user_func_array($eh,$a); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F181G
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   1

Function event:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 38
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 37
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 37
Branch analysis from position: 31
Branch analysis from position: 37
Branch analysis from position: 38
filename:       /in/F181G
function name:  event
number of ops:  39
compiled vars:  !0 = $name, !1 = $cb, !2 = $e, !3 = $a, !4 = $eh
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    3     2        BIND_STATIC                                              !2
    4     3        INIT_FCALL                                               'is_callable'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6      > JMPZ                                                     $5, ->20
    5     7    >   ISSET_ISEMPTY_DIM_OBJ                         1          !2, !0
          8      > JMPZ                                                     ~6, ->14
          9    >   INIT_ARRAY                                       ~8      !1
         10        ASSIGN_DIM                                       ~7      !2, !0
         11        OP_DATA                                                  ~8
         12        QM_ASSIGN                                        ~9      ~7
         13      > JMP                                                      ->18
         14    >   FETCH_DIM_W                                      $10     !2, !0
         15        ASSIGN_DIM                                       ~11     $10
         16        OP_DATA                                                  !1
         17        QM_ASSIGN                                        ~9      ~11
         18    >   FREE                                                     ~9
         19      > JMP                                                      ->38
    6    20    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~12     !2, !0
         21        TYPE_CHECK                                    4          ~12
         22      > JMPZ                                                     ~13, ->38
    7    23    >   TYPE_CHECK                                  128          !1
         24      > JMPZ                                                     ~14, ->27
         25    >   QM_ASSIGN                                        ~15     !1
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~15     <array>
         28    >   ASSIGN                                                   !3, ~15
    8    29        FETCH_DIM_R                                      ~17     !2, !0
         30      > FE_RESET_R                                       $18     ~17, ->37
         31    > > FE_FETCH_R                                               $18, !4, ->37
         32    >   INIT_USER_CALL                                0          'call_user_func_array', !4
         33        SEND_ARRAY                                               !3
         34        CHECK_UNDEF_ARGS                                         
         35        DO_FCALL                                      0          
         36      > JMP                                                      ->31
         37    >   FE_FREE                                                  $18
   10    38    > > RETURN                                                   null

End of function event

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.63 ms | 1400 KiB | 15 Q