array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.uopz-copy.php', 1 => 'uopz_copy', ), 'up' => array ( 0 => 'ref.uopz.php', 1 => 'Fonctions Uopz', ), 'prev' => array ( 0 => 'function.uopz-compose.php', 1 => 'uopz_compose', ), 'next' => array ( 0 => 'function.uopz-del-function.php', 1 => 'uopz_del_function', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/uopz/functions/uopz-copy.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL uopz 1 >= 1.0.4, PECL uopz 2)
uopz_copy — Copie une fonction
Cette fonction a été SUPPRIMEE dand PECL uopz 5.0.0.
Copie une fonction à partir de son nom.
class
Le nom de la classe contenant la fonction à copier
function
Le nom de la fonction
Une closure pour la fonction spécifiée.
Exemple #1 Exemple avec uopz_copy()
<?php
$strtotime = uopz_copy('strtotime');
uopz_function("strtotime", function($arg1, $arg2) use($strtotime) {
/* on peut appeler la fonction strtotime original depuis ici */
var_dump($arg1);
});
var_dump(strtotime('dummy'));
?>
L'exemple ci-dessus va afficher :
string(5) "dummy"