No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

uopz_add_function

(PECL uopz 5, PECL uopz 6)

uopz_add_functionAdds non-existent function or method

Description

uopz_add_function ( string $function , Closure $handler [, int &$flags = ZEND_ACC_PUBLIC ] ) : bool
uopz_add_function ( string $class , string $function , Closure $handler [, int &$flags = ZEND_ACC_PUBLIC [, int &$all = TRUE ]] ) : bool

Adds a non-existent function or method.

PHP: uopz_add_function - Manual Home of Manuel PHP  Contents Haut

Parameters

class

The name of the class.

function

The name of the function or method.

handler

The Closure that defines the new function or method.

flags

Flags to set for the new function or method.

all

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

PHP: uopz_add_function - Manual Home of Manuel PHP  Contents Haut

Return Values

Returns TRUE on success or FALSE on failure.

PHP: uopz_add_function - Manual Home of Manuel PHP  Contents Haut

Errors/Exceptions

uopz_add_function() throws a RuntimeException if the function or method to add already exists.

PHP: uopz_add_function - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 Basic uopz_add_function() Usage

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

The above example will output:

bar

PHP: uopz_add_function - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph