3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { function FUNC() { return __NAMESPACE__; } $closure = function () { var_dump(FUNC()); }; $closure(); $closure(); } namespace Foo { function FUNC() { return __NAMESPACE__; } class Scope {} $closure = function () { var_dump(FUNC()); }; $closure(); } namespace Bar { function FUNC() { return __NAMESPACE__; } class Scope {} $closure = function () { var_dump(\FUNC()); }; $closure(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFLI8
function name:  (null)
number of ops:  15
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlFLI8%3A7%240'
          1        ASSIGN                                                   !0, ~1
   11     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   12     4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0          
   21     6        DECLARE_LAMBDA_FUNCTION                                  '%00foo%5C%7Bclosure%7D%2Fin%2FlFLI8%3A21%241'
          7        ASSIGN                                                   !0, ~5
   24     8        INIT_DYNAMIC_CALL                                        !0
          9        DO_FCALL                                      0          
   33    10        DECLARE_LAMBDA_FUNCTION                                  '%00bar%5C%7Bclosure%7D%2Fin%2FlFLI8%3A33%242'
         11        ASSIGN                                                   !0, ~8
   36    12        INIT_DYNAMIC_CALL                                        !0
         13        DO_FCALL                                      0          
   38    14      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFLI8
function name:  FUNC
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   ''
    6     1*     > RETURN                                                   null

End of function func

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

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

Function foo%5Cfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFLI8
function name:  Foo\FUNC
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   'Foo'
   19     1*     > RETURN                                                   null

End of function foo%5Cfunc

Function %00foo%5C%7Bclosure%7D%2Fin%2FlFLI8%3A21%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFLI8
function name:  Foo\{closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cvar_dump'
          1        INIT_NS_FCALL_BY_NAME                                    'Foo%5CFUNC'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF_EX                                       $0
          4        DO_FCALL                                      0          
   23     5      > RETURN                                                   null

End of function %00foo%5C%7Bclosure%7D%2Fin%2FlFLI8%3A21%241

Function bar%5Cfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFLI8
function name:  Bar\FUNC
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E > > RETURN                                                   'Bar'
   31     1*     > RETURN                                                   null

End of function bar%5Cfunc

Function %00bar%5C%7Bclosure%7D%2Fin%2FlFLI8%3A33%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFLI8
function name:  Bar\{closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_NS_FCALL_BY_NAME                                    'Bar%5Cvar_dump'
          1        INIT_FCALL                                               'func'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF_EX                                       $0
          4        DO_FCALL                                      0          
   35     5      > RETURN                                                   null

End of function %00bar%5C%7Bclosure%7D%2Fin%2FlFLI8%3A33%242

Class Foo\Scope: [no user functions]
Class Bar\Scope: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.8 ms | 1403 KiB | 18 Q