cvs: phpdoc-fr /language functions.xml
| From: | Damien Seguy | Date: | Thu, 26 Mar 2009 13:15:46 +0000 |
| Subject: | cvs: phpdoc-fr /language functions.xml | ||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-6855@lists.php.net to get a copy of this message | ||
dams Thu Mar 26 13:15:46 2009 UTC
Modified files:
/phpdoc-fr/language functions.xml
Log:
synch with en
http://cvs.php.net/viewvc.cgi/phpdoc-fr/language/functions.xml?r1=1.52&r2=1.53&diff_format=u
Index: phpdoc-fr/language/functions.xml
diff -u phpdoc-fr/language/functions.xml:1.52 phpdoc-fr/language/functions.xml:1.53
--- phpdoc-fr/language/functions.xml:1.52 Sun Jun 8 18:44:27 2008
+++ phpdoc-fr/language/functions.xml Thu Mar 26 13:15:45 2009
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.52 $ -->
-<!-- EN-Revision: 1.69 Maintainer: yannick Status: ready -->
+<!-- $Revision: 1.53 $ -->
+<!-- EN-Revision: 1.70 Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->
<chapter xml:id="language.functions" xmlns="http://docbook.org/ns/docbook">
@@ -623,6 +623,42 @@
</para>
</sect1>
+ <sect1 xml:id="functions.anonymous">
+ <title>Fonctions anonymes</title>
+ <para>
+ Les fonctions anonymes permettent la création de fonctions
+ sans préciser leur nom. Elles sont particulièrement utiles
+ comme <link linkend="language.types.callback">fonction de rappel</link>,
+ mais leur utilisation n'est pas limitée à ce seul usage.
+ </para>
+ <para>
+ <example>
+ <title>Exemples avec des fonctions anonymes</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+echo preg_replace_callback('~-([a-z])~', function ($match) {
+ return strtoupper($match[1]);
+}, 'bonjour-le-monde');
+// outputs bonjourLeMonde
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ Les fonctions anonymes sont implémentées en interne par
+ la classe prédéfinie
+ <link
linkend="reserved.classes.closure"><literal>Closure</literal></link>.
+ </para>
+ <note>
+ <para>
+ Les fonctions anonymes sont disponibles depuis PHP 5.3.0.
+ </para>
+ </note>
+ </sect1>
+
+
</chapter>
<!-- Keep this comment at the end of the file