3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const BAR = 'bar'; } var_dump(Foo::BAR); $foo = new Foo(); var_dump($foo::BAR); $foo = 'Foo'; var_dump($foo::BAR);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0qYe6
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'bar'
          2        DO_ICALL                                                 
    8     3        NEW                                              $2      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
    9     6        INIT_FCALL                                               'var_dump'
          7        FETCH_CLASS                                   0  $5      !0
          8        FETCH_CLASS_CONSTANT                             ~6      $5, 'BAR'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
   10    11        ASSIGN                                                   !0, 'Foo'
   11    12        INIT_FCALL                                               'var_dump'
         13        FETCH_CLASS                                   0  $9      !0
         14        FETCH_CLASS_CONSTANT                             ~10     $9, 'BAR'
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.1 ms | 1394 KiB | 15 Q