Doc #72620 [NEW]: array_map example 3
| From: | ilhankapukaya at gmail dot com | Date: | Tue, 19 Jul 2016 13:11:12 +0000 |
| Subject: | Doc #72620 [NEW]: array_map example 3 | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13738@lists.php.net to get a copy of this message | ||
From: ilhankapukaya at gmail dot com
Operating system: windows 8.1
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:array_map example 3
Description:
------------
function show_Spanish($n, $m)
{
return("İspanyolcada $n sayısının ismi:");
// It should be like
// return("İspanyolcada $n sayısının ismi: ".$m );
}
function map_Spanish($n, $m)
{
return(array($n => $m));
}
$a = array(1, 2, 3, 4, 5);
$b = array("uno", "dos", "tres", "cuatro",
"cinco");
$c = array_map("show_Spanish", $a, $b);
print_r($c);
$d = array_map("map_Spanish", $a , $b);
print_r($d);
?>
Expected result:
----------------
// $c çıktısı
Array
(
[0] => İspanyolcada 1 sayısının ismi:
[1] => İspanyolcada 2 sayısının ismi:
[2] => İspanyolcada 3 sayısının ismi:
[3] => İspanyolcada 4 sayısının ismi:
[4] => İspanyolcada 5 sayısının ismi:
)
// $d çıktısı
Array
(
[0] => Array
(
[1] => uno
)
[1] => Array
(
[2] => dos
)
[2] => Array
(
[3] => tres
)
[3] => Array
(
[4] => cuatro
)
[4] => Array
(
[5] => cinco
)
)
Actual result:
--------------
// $c çıktısı
Array
(
[0] => İspanyolcada 1 sayısının ismi: uno
[1] => İspanyolcada 2 sayısının ismi: dos
[2] => İspanyolcada 3 sayısının ismi: tres
[3] => İspanyolcada 4 sayısının ismi: cuatro
[4] => İspanyolcada 5 sayısının ismi: cinco
)
// $d çıktısı
Array
(
[0] => Array
(
[1] => uno
)
[1] => Array
(
[2] => dos
)
[2] => Array
(
[3] => tres
)
[3] => Array
(
[4] => cuatro
)
[4] => Array
(
[5] => cinco
)
)
--
Edit bug report at https://bugs.php.net/bug.php?id=72620&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72620&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72620&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72620&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72620&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72620&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72620&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72620&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72620&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72620&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72620&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72620&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72620&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72620&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72620&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72620&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72620&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72620&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72620&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72620&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72620&r=mysqlcfg