3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2FvsDJZ%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vsDJZ
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvsDJZ%3A7%240

Function %00%7Bclosure%7D%2Fin%2FvsDJZ%3A14%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vsDJZ
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   16     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvsDJZ%3A14%241

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vsDJZ
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvsDJZ%3A7%240'
    9     1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vsDJZ
function name:  baz
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%2FvsDJZ%3A14%241'
   16     1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function baz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.95 ms | 1400 KiB | 15 Q