php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72577 [PT_BR] Error in Example Documentation for array_fill
Submitted: 2016-07-11 18:46 UTC Modified: 2016-07-12 10:59 UTC
From: frederico at ufti dot com dot br Assigned: cmb (profile)
Status: Closed Package: Translation problem
PHP Version: 5.6.23 OS: Linux Mint
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: frederico at ufti dot com dot br
New email:
PHP Version: OS:

 

 [2016-07-11 18:46 UTC] 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
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-11 18:55 UTC] frederico at ufti dot com dot br
pt_BR translate
 [2016-07-11 18:59 UTC] requinix@php.net
-Summary: Error in Example Documentation +Summary: [PT_BR] Error in Example Documentation for array_fill -Status: Open +Status: Verified -Package: Documentation problem +Package: Translation problem
 [2016-07-11 18:59 UTC] requinix@php.net
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.
 [2016-07-12 10:50 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=339651
Log: Fix bug #72577: [PT_BR] Error in Example Documentation for array_fill
 [2016-07-12 10:59 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-07-12 10:59 UTC] cmb@php.net
> Note: the Korean example uses -2,2 with the appropriate output.
> Might be worth adjusting to fit the others.

The Korean translation of this page is outdated anyway, see
<http://svn.php.net/viewvc/phpdoc/en/trunk/reference/array/functions/array-fill.xml?r1=288721&r2=335201>.

Unfortunately, the whole Korean translation is in a very bad
shape, see <http://doc.php.net/revcheck.php?p=graph&lang=kr> and
<http://news.php.net/php.doc.kr/>. In comparison with other
translations (<http://doc.php.net/revcheck.php>), it is by far the
most incomplete translation still available in the online manual,
whereas bg, it and pl which appear to be more up-to-date are not
available. I suggest to move kr to $INACTIVE_ONLINE_LANGUAGES
(<https://github.com/php/web-php/blob/master/include/languages.inc#L61-L86>).
I'll make a respective PR later.
 [2016-07-12 10:59 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-12-30 10:45 UTC] nikic@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/pt_br.git;a=commit;h=d813afe791e6833802e5e5c291c292e03ff24003
Log: Fix bug #72577: [PT_BR] Error in Example Documentation for array_fill
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 06:01:35 2024 UTC