3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { static function foo() { echo 'OK', PHP_EOL; } } T::foo(); fb_intercept('T::foo', function() { echo 'NOT '; }); T::foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h1hLS
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'T', 'foo'
          1        DO_FCALL                                      0          
   13     2        INIT_FCALL_BY_NAME                                       'fb_intercept'
          3        SEND_VAL_EX                                              'T%3A%3Afoo'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fh1hLS%3A13%240'
   15     5        SEND_VAL_EX                                              ~1
          6        DO_FCALL                                      0          
   17     7        INIT_STATIC_METHOD_CALL                                  'T', 'foo'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2Fh1hLS%3A13%240

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

End of function foo

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.46 ms | 1393 KiB | 13 Q