3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace X; eval('function c() { var_dump("global"); }'); function foo() { c(); } function foo2() { c(); } foo(); eval('namespace X; function c() { var_dump("namespaced"); }'); foo(); foo2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A5kUZ
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INCLUDE_OR_EVAL                                          'function+c%28%29+%7B+var_dump%28%22global%22%29%3B+%7D', EVAL
   15     1        INIT_NS_FCALL_BY_NAME                                    'X%5Cfoo'
          2        DO_FCALL                                      0          
   17     3        INCLUDE_OR_EVAL                                          'namespace+X%3B+function+c%28%29+%7B+var_dump%28%22namespaced%22%29%3B+%7D', EVAL
   19     4        INIT_NS_FCALL_BY_NAME                                    'X%5Cfoo'
          5        DO_FCALL                                      0          
   20     6        INIT_NS_FCALL_BY_NAME                                    'X%5Cfoo2'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function x%5Cfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A5kUZ
function name:  X\foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_NS_FCALL_BY_NAME                                    'X%5Cc'
          1        DO_FCALL                                      0          
    9     2      > RETURN                                                   null

End of function x%5Cfoo

Function x%5Cfoo2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A5kUZ
function name:  X\foo2
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_NS_FCALL_BY_NAME                                    'X%5Cc'
          1        DO_FCALL                                      0          
   13     2      > RETURN                                                   null

End of function x%5Cfoo2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
221.4 ms | 1000 KiB | 18 Q