php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72116 7.0.6 array_fill optimization breaks implementation
Submitted: 2016-04-28 08:16 UTC Modified: -
From: sjon at hortensius dot net Assigned:
Status: Closed Package: Arrays related
PHP Version: Next Minor Version OS: Archlinux
Private report: No CVE-ID: None
 [2016-04-28 08:16 UTC] sjon at hortensius dot net
Description:
------------
The soon to be released 7.0.6 ( is already in distro's repos) will break array_fill, see https://3v4l.org/ji79d

This is most likely caused by https://github.com/php/php-src/commit/b31240f995a742b363074e0079b1aef4e577a27e 

Test script:
---------------
<?php

$x = array_fill(0, 1, '..');
$x[] = 'a';
var_dump($x);

Expected result:
----------------
array(2) { [0]=> string(2) ".." [1]=> string(1) "a" }

Actual result:
--------------
Warning: Cannot add element to the array as the next element is already occupied in /in/ji79d on line 4 array(1) { [0]=> string(2) ".." }

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-28 09:02 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=74ef863f5d83c8ab7377eb7ca27a6ffc4b7502ae
Log: Fixed bug #72116 (7.0.6 array_fill optimization breaks implementation)
 [2016-04-28 09:03 UTC] bwoebi@php.net
-Status: Open +Status: Closed
 [2016-04-28 09:11 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=74ef863f5d83c8ab7377eb7ca27a6ffc4b7502ae
Log: Fixed bug #72116 (7.0.6 array_fill optimization breaks implementation)
 [2016-04-28 17:43 UTC] ab@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ee2c9065d8c6dfbefb32273d409b583fcbf1977d
Log: Fixed bug #72116 (7.0.6 array_fill optimization breaks implementation)
 [2016-07-20 11:31 UTC] davey@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=74ef863f5d83c8ab7377eb7ca27a6ffc4b7502ae
Log: Fixed bug #72116 (7.0.6 array_fill optimization breaks implementation)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC