3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { const CONSTANT = 'GLOBAL'; var_dump($closure); } namespace Foo { const CONSTANT = __NAMESPACE__; $closure = function () { return CONSTANT; }; } namespace Bar { const CONSTANT = __NAMESPACE__; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8P1ro
function name:  (null)
number of ops:  9
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CONST                                            'CONSTANT', 'GLOBAL'
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   10     4        DECLARE_CONST                                            'Foo%5CCONSTANT', 'Foo'
   12     5        DECLARE_LAMBDA_FUNCTION                                  '%00foo%5C%7Bclosure%7D%2Fin%2F8P1ro%3A12%240'
          6        ASSIGN                                                   !0, ~2
   19     7        DECLARE_CONST                                            'Bar%5CCONSTANT', 'Bar'
   21     8      > RETURN                                                   1

Function %00foo%5C%7Bclosure%7D%2Fin%2F8P1ro%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8P1ro
function name:  Foo\{closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_CONSTANT                                   ~0      'Foo%5CCONSTANT'
          1      > RETURN                                                   ~0
   14     2*     > RETURN                                                   null

End of function %00foo%5C%7Bclosure%7D%2Fin%2F8P1ro%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.2 ms | 1386 KiB | 15 Q