uopz_add_function
(PECL uopz 5, PECL uopz 6, PECL uopz 7)
Adds non-existent function or method
Description
Adds a non-existent function or method.
Parameters
classThe name of the class.
functionThe name of the function or method.
handlerThe
Closurethat defines the new function or method.flagsFlags to set for the new function or method.
allWhether all classes that descend from
classwill also be affected.
Return Values
Success
Errors/Exceptions
uopz_add_function() throws a RuntimeException if the function or method to add already exists.
Examples
Basic uopz_add_function() Usage
<?php
uopz_add_function('foo', function () {echo 'bar';});
foo();
?>The above example will output:
bar