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'; }

preferences:
53.21 ms | 402 KiB | 5 Q