3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo { class Bar {} define('foo\FOO', 1); } namespace { class Bar {} define('\FOO', 2); } namespace baz { var_dump(new \foo\Bar); var_dump(new \Bar); var_dump(\foo\FOO, \FOO); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Q8ei
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_NS_FCALL_BY_NAME                                    'foo%5Cdefine'
          1        SEND_VAL_EX                                              'foo%5CFOO'
          2        SEND_VAL_EX                                              1
          3        DO_FCALL                                      0          
   10     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 '%5CFOO'
          6        SEND_VAL                                                 2
          7        DO_ICALL                                                 
   14     8        INIT_NS_FCALL_BY_NAME                                    'baz%5Cvar_dump'
          9        NEW                                              $2      'foo%5CBar'
         10        DO_FCALL                                      0          
         11        SEND_VAR_NO_REF_EX                                       $2
         12        DO_FCALL                                      0          
   15    13        INIT_NS_FCALL_BY_NAME                                    'baz%5Cvar_dump'
         14        NEW                                              $5      'Bar'
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $5
         17        DO_FCALL                                      0          
   16    18        INIT_NS_FCALL_BY_NAME                                    'baz%5Cvar_dump'
         19        FETCH_CONSTANT                                   ~8      'foo%5CFOO'
         20        SEND_VAL_EX                                              ~8
         21        FETCH_CONSTANT                                   ~9      'FOO'
         22        SEND_VAL_EX                                              ~9
         23        DO_FCALL                                      0          
   17    24      > RETURN                                                   1

Class foo\Bar: [no user functions]
Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.98 ms | 1395 KiB | 17 Q