php8.5
Home/ Manual/ uopz / functions/ uopz_undefine

uopz_undefine

PHP function Edit on GitHub ✎

(PECL uopz 1, PECL uopz 2, PECL uopz 5, PECL uopz 6, PECL uopz 7)

Undefine a constant

Description

uopz_undefine(string $constant): bool
uopz_undefine(string $class, string $constant): bool

Removes the constant at runtime

Parameters

class

The name of the class containing constant

constant

The name of an existing constant

Return Values

Success

Examples

uopz_undefine() example

php
<?php
define("MY", true);

uopz_undefine("MY");

var_dump(defined("MY"));
?>

The above example will output:

output
bool(false)

Source: reference/uopz/functions/uopz-undefine.xml · from the official PHP manual (php/doc-en)