3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(defined("WHATEVER_THIS_ISNT_DEFINED")){ // double quotes needed! echo 'yup, constant defined'; } else { echo 'nope, does not exist'; } if(defined('WHATEVER_THIS_ISNT_DEFINED')){ // single quotes won't suppress error notice? no, they work! echo 'yup, constant defined'; } else { echo 'nope, does not exist'; } if(defined(WHATEVER_THIS_ISNT_DEFINED)){ // no quotes then error notice echo 'yup, constant defined'; } else { echo 'nope, does not exist'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
Branch analysis from position: 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
Branch analysis from position: 9
filename:       /in/9gGRD
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DEFINED                                                  'WHATEVER_THIS_ISNT_DEFINED'
          1      > JMPZ                                                     ~0, ->4
    3     2    >   ECHO                                                     'yup%2C+constant+defined'
          3      > JMP                                                      ->5
    7     4    >   ECHO                                                     'nope%2C+does+not+exist'
   10     5    >   DEFINED                                                  'WHATEVER_THIS_ISNT_DEFINED'
          6      > JMPZ                                                     ~1, ->9
   11     7    >   ECHO                                                     'yup%2C+constant+defined'
          8      > JMP                                                      ->10
   15     9    >   ECHO                                                     'nope%2C+does+not+exist'
   17    10    >   INIT_FCALL                                               'defined'
         11        FETCH_CONSTANT                                   ~2      'WHATEVER_THIS_ISNT_DEFINED'
         12        SEND_VAL                                                 ~2
         13        DO_ICALL                                         $3      
         14      > JMPZ                                                     $3, ->17
   18    15    >   ECHO                                                     'yup%2C+constant+defined'
         16      > JMP                                                      ->18
   22    17    >   ECHO                                                     'nope%2C+does+not+exist'
   23    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.7 ms | 1395 KiB | 15 Q