3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; class Bar { const BAZ = 'hello'; } $f = new Bar; var_dump(Bar::CLASS); // dumps "Foo\Bar" var_dump($f::BAZ); // dumps "hello" var_dump($f::CLASS); // Results in syntax error
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/si06v
function name:  (null)
number of ops:  16
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'Foo%5CBar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cvar_dump'
          4        SEND_VAL_EX                                              'Foo%5CBar'
          5        DO_FCALL                                      0          
   13     6        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cvar_dump'
          7        FETCH_CLASS                                   0  $5      !0
          8        FETCH_CLASS_CONSTANT                             ~6      $5, 'BAZ'
          9        SEND_VAL_EX                                              ~6
         10        DO_FCALL                                      0          
   14    11        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cvar_dump'
         12        FETCH_CLASS_NAME                                 ~8      !0
         13        SEND_VAL_EX                                              ~8
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Class Foo\Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.8 ms | 1394 KiB | 15 Q