3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.07 ms | 1394 KiB | 19 Q