Doc #72577 [Opn->Ver]: [PT_BR] Error in Example Documentation for array_fill
| From: | requinix@php.net | Date: | Mon, 11 Jul 2016 18:59:53 +0000 |
| Subject: | Doc #72577 [Opn->Ver]: [PT_BR] Error in Example Documentation for array_fill | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13714@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72577&edit=1
ID: 72577
Updated by: requinix@php.net
Reported by: frederico at ufti dot com dot br
-Summary: Error in Example Documentation
+Summary: [PT_BR] Error in Example Documentation for
array_fill
-Status: Open
+Status: Verified
Type: Documentation Problem
-Package: Documentation problem
+Package: Translation problem
Operating System: Linux Mint
PHP Version: 5.6.23
Block user comment: N
Private report: N
New Comment:
This version uses array_fill(-2,2,pear) but shows the output for array_fill(-2,4,pear).
Note: the Korean example uses -2,2 with the appropriate output. Might be worth adjusting to fit the
others.
Previous Comments:
------------------------------------------------------------------------
[2016-07-11 18:55:56] frederico at ufti dot com dot br
pt_BR translate
------------------------------------------------------------------------
[2016-07-11 18:46:15] frederico at ufti dot com dot br
Description:
------------
---
From manual page: http://www.php.net/function.array-fill
---
In the first example the return of results is incorrect
<?php
$a = array_fill(5, 6, 'banana');
$b = array_fill(-2, 2, 'pear');
print_r($a);
print_r($b);
?>
Incorrect result documentation
Array
(
[5] => banana
[6] => banana
[7] => banana
[8] => banana
[9] => banana
[10] => banana
)
Array
(
[-2] => pear
[0] => pear
[1] => pear
[2] => pear
)
Test script:
---------------
http://sandbox.onlinephpfunctions.com/code/8e74eb9d9158db1c327a41ec6cf9102ada19e0dc
<?php
$a = array_fill(5, 6, 'banana');
$b = array_fill(-2, 2, 'pear');
print_r($a);
print_r($b);
?>
Expected result:
----------------
valid return
Array
(
[5] => banana
[6] => banana
[7] => banana
[8] => banana
[9] => banana
[10] => banana
)
Array
(
[-2] => pear
[0] => pear
)
Actual result:
--------------
Incorrect result documentation
Array
(
[5] => banana
[6] => banana
[7] => banana
[8] => banana
[9] => banana
[10] => banana
)
Array
(
[-2] => pear
[0] => pear
[1] => pear
[2] => pear
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72577&edit=1