3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function foo() { echo 'clap', PHP_EOL; } } class B extends A { function bar() { echo 'claptrap'; } } fb_intercept('A::foo', function() { echo 'frap', PHP_EOL; }); (new A)->foo(); (new B)->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2MA3s
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL_BY_NAME                                       'fb_intercept'
          1        SEND_VAL_EX                                              'A%3A%3Afoo'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2MA3s%3A19%240'
   21     3        SEND_VAL_EX                                              ~0
          4        DO_FCALL                                      0          
   23     5        NEW                                              $2      'A'
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $2, 'foo'
          8        DO_FCALL                                      0          
   24     9        NEW                                              $5      'B'
         10        DO_FCALL                                      0          
         11        INIT_METHOD_CALL                                         $5, 'foo'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F2MA3s%3A19%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2MA3s
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'frap'
          1        ECHO                                                     '%0A'
   21     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2MA3s%3A19%240

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

End of function foo

End of class A.

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

End of function bar

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.54 ms | 1390 KiB | 13 Q