note 126204 added to function.array-fill
| From: | user at NOSPAM dot example dot com | Date: | Wed, 30 Jun 2021 04:28:39 +0000 |
| Subject: | note 126204 added to function.array-fill | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216560@lists.php.net to get a copy of this message | ||
As of PHP 8.0 the example code
<?php
$b = array_fill(-2, 4, 'pear');
print_r($b);
?>
now returns
Array
(
[-2] => pear
[-1] => pear
[0] => pear
[1] => pear
)
See https://wiki.php.net/rfc/negative_array_index
and https://github.com/php/php-src/pull/3772
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 2a0b:f4c1:2::244)
----
Manual Page -- https://php.net/manual/en/function.array-fill.php
Edit -- https://main.php.net/note/edit/126204
Del: integrated -- https://main.php.net/note/delete/126204/integrated
Del: useless -- https://main.php.net/note/delete/126204/useless
Del: bad code -- https://main.php.net/note/delete/126204/bad+code
Del: spam -- https://main.php.net/note/delete/126204/spam
Del: non-english -- https://main.php.net/note/delete/126204/non-english
Del: in docs -- https://main.php.net/note/delete/126204/in+docs
Del: other reasons-- https://main.php.net/note/delete/126204
Reject -- https://main.php.net/note/reject/126204
Search -- https://main.php.net/manage/user-notes.php