cvs: phpdoc /en/reference/array/functions array-map.xml
| From: | Felipe Pena | Date: | Sat, 30 Aug 2008 14:23:24 +0000 |
| Subject: | cvs: phpdoc /en/reference/array/functions array-map.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2115@lists.php.net to get a copy of this message | ||
felipe Sat Aug 30 14:23:24 2008 UTC
Modified files:
/phpdoc/en/reference/array/functions array-map.xml
Log:
- New example
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/array/functions/array-map.xml?r1=1.20&r2=1.21&diff_format=u
Index: phpdoc/en/reference/array/functions/array-map.xml
diff -u phpdoc/en/reference/array/functions/array-map.xml:1.20
phpdoc/en/reference/array/functions/array-map.xml:1.21
--- phpdoc/en/reference/array/functions/array-map.xml:1.20 Sun Jan 20 14:56:59 2008
+++ phpdoc/en/reference/array/functions/array-map.xml Sat Aug 30 14:23:24 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.20 $ -->
+<!-- $Revision: 1.21 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.array-map">
<refnamediv>
<refname>array_map</refname>
@@ -101,6 +101,34 @@
]]>
</screen>
</example>
+ <example>
+ <title><function>array_map</function> using lambda function (as of PHP
5.3.0)</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+/* As of PHP 5.3.0 */
+
+$func = function($value) { return $value * 2; };
+
+print_r(array_map($func, range(1, 5)));
+
+?>
+]]>
+ </programlisting>
+ <screen>
+<![CDATA[
+Array
+(
+ [0] => 2
+ [1] => 4
+ [2] => 6
+ [3] => 8
+ [4] => 10
+)
+]]>
+ </screen>
+ </example>
</para>
</refsect1>