Doc #72577 [Opn]: Error in Example Documentation

From: Date: Mon, 11 Jul 2016 18:55:57 +0000
Subject: Doc #72577 [Opn]: Error in Example Documentation
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13713@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 User updated by: frederico at ufti dot com dot br Reported by: frederico at ufti dot com dot br Summary: Error in Example Documentation Status: Open Type: Documentation Problem Package: Documentation problem Operating System: Linux Mint PHP Version: 5.6.23 Block user comment: N Private report: N New Comment: pt_BR translate Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#13713) next »