3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FOO { const BAR = 'hi'; } $cls = 'FOO'; $const = 'BAR'; var_dump(defined($cls.'::'.$const)); var_dump(constant($cls.'::'.$const));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/579j7
function name:  (null)
number of ops:  19
compiled vars:  !0 = $cls, !1 = $const
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'FOO'
    8     1        ASSIGN                                                   !1, 'BAR'
   10     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'defined'
          4        CONCAT                                           ~4      !0, '%3A%3A'
          5        CONCAT                                           ~5      ~4, !1
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                                 
   11    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'constant'
         12        CONCAT                                           ~8      !0, '%3A%3A'
         13        CONCAT                                           ~9      ~8, !1
         14        SEND_VAL                                                 ~9
         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:
254.01 ms | 1394 KiB | 19 Q