3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { call_user_func(function () { var_dump(__FUNCTION__, __METHOD__); }); class Foo { public function method () { return function () { var_dump(__FUNCTION__, __METHOD__); }; } } $closure = (new Foo())->method(); $closure(); } namespace InNamespace { var_dump(__CLASS__); call_user_func(function () { var_dump(__FUNCTION__, __METHOD__); }); 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/lP2AD
function name:  (null)
number of ops:  25
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlP2AD%3A5%240'
          1        INIT_USER_CALL                                0          'call_user_func', ~1
          2        DO_FCALL                                      0          
   13     3        NEW                                              $3      'Foo'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $3, 'method'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
   14     8        INIT_DYNAMIC_CALL                                        !0
          9        DO_FCALL                                      0          
   18    10        INIT_NS_FCALL_BY_NAME                                    'InNamespace%5Cvar_dump'
         11        SEND_VAL_EX                                              ''
         12        DO_FCALL                                      0          
   19    13        INIT_NS_FCALL_BY_NAME                                    'InNamespace%5Ccall_user_func'
         14        DECLARE_LAMBDA_FUNCTION                                  '%00innamespace%5C%7Bclosure%7D%2Fin%2FlP2AD%3A19%242'
         15        SEND_VAL_EX                                              ~9
         16        DO_FCALL                                      0          
   27    17        NEW                                              $11     'InNamespace%5CFoo'
         18        DO_FCALL                                      0          
         19        INIT_METHOD_CALL                                         $11, 'method'
         20        DO_FCALL                                      0  $13     
         21        ASSIGN                                                   !0, $13
   28    22        INIT_DYNAMIC_CALL                                        !0
         23        DO_FCALL                                      0          
   30    24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FlP2AD%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lP2AD
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     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%2FlP2AD%3A5%240

Function %00%7Bclosure%7D%2Fin%2FlP2AD%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lP2AD
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     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%2FlP2AD%3A9%241

Function %00innamespace%5C%7Bclosure%7D%2Fin%2FlP2AD%3A19%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lP2AD
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%2FlP2AD%3A19%242

Function %00innamespace%5C%7Bclosure%7D%2Fin%2FlP2AD%3A23%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lP2AD
function name:  InNamespace\{closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     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%2FlP2AD%3A23%243

Class Foo:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lP2AD
function name:  method
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlP2AD%3A9%241'
          1      > RETURN                                                   ~0
   10     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/lP2AD
function name:  method
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00innamespace%5C%7Bclosure%7D%2Fin%2FlP2AD%3A23%243'
          1      > RETURN                                                   ~0
   24     2*     > RETURN                                                   null

End of function method

End of class InNamespace\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.15 ms | 1405 KiB | 17 Q