PHP.nl

uopz_add_function

uopz_add_function

Adds non-existent function or method

bool **uopz_add_function** string $function Closure $handler int $flags
bool **uopz_add_function** string $class string $function Closure $handler int $flags int $all

Adds a non-existent function or method.

classThe name of the class.

functionThe name of the function or method.

handler The that defines the new function or method. Closure

flagsFlags to set for the new function or method.

all Whether all classes that descend from will also be affected. class

return.success

throws a 

if the function or method to add already exists. uopz_add_function``RuntimeException

Voorbeeld: Basic Usage

<?php
uopz_add_function('foo', function () {echo 'bar';});
foo();
?>
bar

uopz_del_function``uopz_set_return