3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { var_dump("in bar"); $a = function() { echo 'a'; }; $a(); } } var_dump((new Foo)->bar()); fb_intercept('Foo::__invoke', function () { echo '__invoke called!'; }); var_dump((new Foo)->bar());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nTcNv
function name:  (null)
number of ops:  20
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'bar'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   16     7        INIT_FCALL_BY_NAME                                       'fb_intercept'
          8        SEND_VAL_EX                                              'Foo%3A%3A__invoke'
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnTcNv%3A16%241'
         10        SEND_VAL_EX                                              ~4
         11        DO_FCALL                                      0          
   17    12        INIT_FCALL                                               'var_dump'
         13        NEW                                              $6      'Foo'
         14        DO_FCALL                                      0          
         15        INIT_METHOD_CALL                                         $6, 'bar'
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FnTcNv%3A6%240

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

End of function %00%7Bclosure%7D%2Fin%2FnTcNv%3A16%241

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nTcNv
function name:  bar
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'in+bar'
          2        DO_ICALL                                                 
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnTcNv%3A6%240'
          4        ASSIGN                                                   !0, ~2
    9     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
   10     7      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.9 ms | 1400 KiB | 15 Q