3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function display() { $cb = self::fooStaticMethod(); call_user_func($cb, $this); } public static function fooStaticMethod() { return function (Foo $foo) { $foo->fooMethod(); }; } private function fooMethod() { var_dump('foo'); } } class Bar extends Foo { } $foo = new Foo(); $foo->display(); $bar = new Bar(); $bar->display();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   32     3        INIT_METHOD_CALL                                         !0, 'display'
          4        DO_FCALL                                      0          
   34     5        NEW                                              $6      'Bar'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   35     8        INIT_METHOD_CALL                                         !1, 'display'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FdiTRh%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_METHOD_CALL                                         !0, 'fooMethod'
          2        DO_FCALL                                      0          
   16     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FdiTRh%3A14%240

Class Foo:
Function display:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  display
number of ops:  8
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'fooStaticMethod'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    9     3        INIT_USER_CALL                                1          'call_user_func', !0
          4        FETCH_THIS                                       ~3      
          5        SEND_USER                                                ~3
          6        DO_FCALL                                      0          
   10     7      > RETURN                                                   null

End of function display

Function foostaticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  fooStaticMethod
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdiTRh%3A14%240'
   16     1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function foostaticmethod

Function foomethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  fooMethod
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'foo'
          2        DO_ICALL                                                 
   22     3      > RETURN                                                   null

End of function foomethod

End of class Foo.

Class Bar:
Function display:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  display
number of ops:  8
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'fooStaticMethod'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    9     3        INIT_USER_CALL                                1          'call_user_func', !0
          4        FETCH_THIS                                       ~3      
          5        SEND_USER                                                ~3
          6        DO_FCALL                                      0          
   10     7      > RETURN                                                   null

End of function display

Function foostaticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  fooStaticMethod
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdiTRh%3A14%240'
   16     1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function foostaticmethod

Function foomethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/diTRh
function name:  fooMethod
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'foo'
          2        DO_ICALL                                                 
   22     3      > RETURN                                                   null

End of function foomethod

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.86 ms | 1400 KiB | 15 Q