3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { class Foo { public function method () { return function () { var_dump(__FUNCTION__, __METHOD__); }; } } $closure = (new Foo())->method(); $closure(); } namespace InNamespace { class Foo { public function method () { return function () { var_dump(__FUNCTION__, __METHOD__); }; } } $closure = (new Foo())->method(); $closure(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4fVFE
function name:  (null)
number of ops:  15
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'method'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   12     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
   23     7        NEW                                              $6      'InNamespace%5CFoo'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $6, 'method'
         10        DO_FCALL                                      0  $8      
         11        ASSIGN                                                   !0, $8
   24    12        INIT_DYNAMIC_CALL                                        !0
         13        DO_FCALL                                      0          
   26    14      > RETURN                                                   1

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

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

Function %00innamespace%5C%7Bclosure%7D%2Fin%2F4fVFE%3A19%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4fVFE
function name:  InNamespace\{closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_NS_FCALL_BY_NAME                                    'InNamespace%5Cvar_dump'
          1        SEND_VAL_EX                                              'InNamespace%5C%7Bclosure%7D'
          2        SEND_VAL_EX                                              'InNamespace%5C%7Bclosure%7D'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   null

End of function %00innamespace%5C%7Bclosure%7D%2Fin%2F4fVFE%3A19%241

Class Foo:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4fVFE
function name:  method
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%2F4fVFE%3A7%240'
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function method

End of class Foo.

Class InNamespace\Foo:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4fVFE
function name:  method
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00innamespace%5C%7Bclosure%7D%2Fin%2F4fVFE%3A19%241'
          1      > RETURN                                                   ~0
   20     2*     > RETURN                                                   null

End of function method

End of class InNamespace\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.8 ms | 1400 KiB | 15 Q