|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-23 08:22 UTC] tony2001@php.net
[2004-10-23 13:08 UTC] smadeira at zoominternet dot net
[2004-10-23 13:12 UTC] derick@php.net
[2004-10-31 01:00 UTC] php-bugs at lists dot php dot net
[2004-12-23 16:28 UTC] garak at studenti dot it
[2005-01-29 23:17 UTC] tigr at mail15 dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 05:00:01 2025 UTC |
Description: ------------ The reproduce code will generate an array dump and should have the "[] => Zero" as the first element in the array. I am running php 4.3.9. configure line is: './configure' '--with-mysql=/usr/local/mysql' '--with-xml' '--with-curl=../../curl/curl-7.1' '--with-apache=../../apache/apache_1.3.31' '--with-openssl' '--with-zlib' '--enable-bcmath' '--enable-calendar' '--enable-dbx' '--enable-ftp' '--with-gd' '--with-mcrypt' '--with-mhash' '--enable-xslt' '--with-xslt-sablot=/usr/local/lib' '--with-expat-dir=/usr/local' '--with-iconv-dir=/usr/local' '--with-pear' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' Reproduce code: --------------- <?php $x = array('01'=>'One','02'=>'Two'); $x = array('' => 'Zero') + $x; print_r($x); ?> Expected result: ---------------- I am expecting this: Array ( [] => Zero [01] => One [02] => Two ) If I run this script: <?php $x = array('01'=>'One','02'=>'Two'); $y = array('' => 'Zero') + $x; print_r($y); ?> I do get the expected result. (Note the use of $y as the union of the two arrays.) Actual result: -------------- Program returns this: Array ( [01] => One [02] => Two [] => Zero )