defined

Checks whether a given named constant exists

Syntax

defined ( string $name ) : bool

Parameters

name

The constant name.

Return

Returns TRUE if the named constant given by name has been defined, FALSE otherwise.

Examples

1

<?

define("MYCONSTANT", "Hello World!");

$return = defined("MYCONSTANT");

var_export($return);

?>
true

2

<?

$return = defined("MYCONSTANT");

var_export($return);

?>
false

__halt_compiler

connection_aborted

connection_status

constant

define

die

eval

exit

highlight_file

highlight_string

hrtime

ignore_user_abort

pack

php_strip_whitespace

show_source

sleep

sys_getloadavg

time_nanosleep

time_sleep_until

uniqid

unpack

usleep

PHP

Home Menu