|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-10-22 13:07 UTC] bwoebi@php.net
-Status: Open
+Status: Not a bug
[2014-10-22 13:07 UTC] bwoebi@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 12:00:01 2025 UTC |
Description: ------------ Adding elements to array resulting from array_diff is allocated with wrong numeric index key. Test script: --------------- <?php $a1 = array( 'one', 'two', 'three', 'four' ); $a2 = array_diff( $a1, array( 'one', 'two', 'three', 'four' ) ); $a3 = $a2; $a3[] = 'five'; print_r($a3); Expected result: ---------------- Array ( [0] => five ) Actual result: -------------- Output for PHP 4.3.0 - 5.4.32, 5.5.0 - 5.5.16, 5.6.0, php7@20140507 - 20140521, php7@20140801, hhvm-3.0.1 - 3.3.0 : Array ( [0] => five ) Output for PHP 5.4.34, 5.5.18, 5.6.1 - 5.6.2, php7@20140701, php7@20140901 - 20141001 : Array ( [4] => five )