3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { function foo() { } } class A { use T; } fb_intercept('A::foo', function($name, $obj, $data, $args, &$done) { echo $name, PHP_EOL; echo $obj, PHP_EOL; $done = true; }); (new A)->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y0aRh
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                                              'A%3A%3Afoo'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FY0aRh%3A15%241'
   19     4        SEND_VAL_EX                                              ~0
          5        DO_FCALL                                      0          
   21     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%2FY0aRh%3A15%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y0aRh
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $name, !1 = $obj, !2 = $data, !3 = $args, !4 = $done
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
   16     5        ECHO                                                     !0
          6        ECHO                                                     '%0A'
   17     7        ECHO                                                     !1
          8        ECHO                                                     '%0A'
   18     9        ASSIGN                                                   !4, <true>
   19    10      > RETURN                                                   null

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

Class T:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y0aRh
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:
220.14 ms | 1395 KiB | 13 Q