Doc #72577 [NEW]: Error in Example Documentation
| From: | frederico at ufti dot com dot br | Date: | Mon, 11 Jul 2016 18:46:16 +0000 |
| Subject: | Doc #72577 [NEW]: Error in Example Documentation | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13712@lists.php.net to get a copy of this message | ||
From: frederico at ufti dot com dot br
Operating system: Linux Mint
PHP version: 5.6.23
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Error in Example Documentation
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 bug report at https://bugs.php.net/bug.php?id=72577&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72577&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72577&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72577&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72577&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72577&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72577&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72577&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72577&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72577&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72577&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72577&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72577&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72577&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72577&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72577&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72577&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72577&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72577&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72577&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72577&r=mysqlcfg