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

uopz_delete

PHP function Deprecated as of PECL uopz 5 Edit on GitHub ✎

(PECL uopz 1, PECL uopz 2)

Delete a function

Function-5-0-0

Description

uopz_delete(string $function): void
uopz_delete(string $class, string $function): void

Deletes a function or method

Parameters

class
function

Return Values

Examples

uopz_delete() example

php
<?php
uopz_delete("strlen");

echo strlen("Hello World");
?>

The above example will output something similar to:

output
PHP Fatal error: Call to undefined function strlen() in /path/to/script.php on line 4

uopz_delete() class example

php
<?php
class My {
    public static function strlen($arg) {
        return strlen($arg);
    }
}

uopz_delete(My::class, "strlen");

echo My::strlen("Hello World");
?>

The above example will output something similar to:

output
PHP Fatal error: Call to undefined method My::strlen() in /path/to/script.php on line 10

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