3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static function fooStaticMethod() { return function (Foo $foo) { $foo->fooMethod(); }; } private function fooMethod() { var_dump('foo'); } } $cb = Foo::fooStaticMethod(); $cb(new Foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9igFZ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'fooStaticMethod'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   21     3        INIT_DYNAMIC_CALL                                        !0
          4        NEW                                              $3      'Foo'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $3
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F9igFZ%3A8%240

Class Foo:
Function foostaticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9igFZ
function name:  fooStaticMethod
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9igFZ%3A8%240'
   10     1      > RETURN                                                   ~0
   11     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/9igFZ
function name:  fooMethod
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'foo'
          2        DO_ICALL                                                 
   16     3      > RETURN                                                   null

End of function foomethod

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.19 ms | 1396 KiB | 15 Q