3v4l.org

run code in 300+ PHP versions simultaneously
<?php const A = 0; $constant = 'A'; if (defined($constant) && ! is_scalar(constant($constant)) && ! is_resource(constant($constant)) && constant($constant) !== null) { echo "Yes, I am non-scalar and non-resource constant!\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 25
Branch analysis from position: 19
Branch analysis from position: 12
filename:       /in/rrqvH
function name:  (null)
number of ops:  28
compiled vars:  !0 = $constant
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'A', 0
    4     1        ASSIGN                                                   !0, 'A'
    6     2        INIT_FCALL                                               'defined'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5      > JMPZ_EX                                          ~3      $2, ->12
          6    >   INIT_FCALL                                               'constant'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        TYPE_CHECK                                  124  ~5      $4
         10        BOOL_NOT                                         ~6      ~5
         11        BOOL                                             ~3      ~6
         12    > > JMPZ_EX                                          ~3      ~3, ->19
         13    >   INIT_FCALL                                               'constant'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $7      
         16        TYPE_CHECK                                  512  ~8      $7
         17        BOOL_NOT                                         ~9      ~8
         18        BOOL                                             ~3      ~9
         19    > > JMPZ_EX                                          ~3      ~3, ->25
         20    >   INIT_FCALL                                               'constant'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $10     
         23        TYPE_CHECK                                  1020  ~11     $10
         24        BOOL                                             ~3      ~11
         25    > > JMPZ                                                     ~3, ->27
    7    26    >   ECHO                                                     'Yes%2C+I+am+non-scalar+and+non-resource+constant%21%0A'
    8    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.46 ms | 1396 KiB | 17 Q