3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { function foo() { } } class A { use T; } fb_intercept('T::foo', function() { var_dump(func_get_args()); }); (new A)->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bjchi
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'a'
   15     1        INIT_FCALL_BY_NAME                                       'fb_intercept'
          2        SEND_VAL_EX                                              'T%3A%3Afoo'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBjchi%3A15%241'
   17     4        SEND_VAL_EX                                              ~0
          5        DO_FCALL                                      0          
   19     6        NEW                                              $2      'A'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $2, 'foo'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FBjchi%3A15%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bjchi
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        FUNC_GET_ARGS                                    ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   17     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBjchi%3A15%241

Class T:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bjchi
function name:  foo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function foo

End of class T.

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.58 ms | 1395 KiB | 15 Q