3v4l.org

run code in 500+ PHP versions simultaneously
<?php const A = 1; class C { public const D = 1; private const E = 1; } use const A as B; // global constants var_dump(defined('A')); var_dump(defined('\A')); var_dump(defined('\\A')); // good joke var_dump(defined('B')); // false var_dump(defined(A)); // checking the constant value // class constants var_dump(defined('C::D')); var_dump(defined('C::E')); // including visibility
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z3Yv9
function name:  (null)
number of ops:  41
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                                'A', 1
   13     1        INIT_FCALL                                                   'var_dump'
          2        DEFINED                                              ~0      'A'
          3        SEND_VAL                                                     ~0
          4        DO_ICALL                                                     
   14     5        INIT_FCALL                                                   'var_dump'
          6        INIT_FCALL                                                   'defined'
          7        SEND_VAL                                                     '%5CA'
          8        DO_ICALL                                             $2      
          9        SEND_VAR                                                     $2
         10        DO_ICALL                                                     
   15    11        INIT_FCALL                                                   'var_dump'
         12        INIT_FCALL                                                   'defined'
         13        SEND_VAL                                                     '%5CA'
         14        DO_ICALL                                             $4      
         15        SEND_VAR                                                     $4
         16        DO_ICALL                                                     
   17    17        INIT_FCALL                                                   'var_dump'
         18        DEFINED                                              ~6      'B'
         19        SEND_VAL                                                     ~6
         20        DO_ICALL                                                     
   18    21        INIT_FCALL                                                   'var_dump'
         22        INIT_FCALL                                                   'defined'
         23        FETCH_CONSTANT                                       ~8      'A'
         24        SEND_VAL                                                     ~8
         25        DO_ICALL                                             $9      
         26        SEND_VAR                                                     $9
         27        DO_ICALL                                                     
   21    28        INIT_FCALL                                                   'var_dump'
         29        INIT_FCALL                                                   'defined'
         30        SEND_VAL                                                     'C%3A%3AD'
         31        DO_ICALL                                             $11     
         32        SEND_VAR                                                     $11
         33        DO_ICALL                                                     
   22    34        INIT_FCALL                                                   'var_dump'
         35        INIT_FCALL                                                   'defined'
         36        SEND_VAL                                                     'C%3A%3AE'
         37        DO_ICALL                                             $13     
         38        SEND_VAR                                                     $13
         39        DO_ICALL                                                     
         40      > RETURN                                                       1

Class C: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.96 ms | 1154 KiB | 15 Q