ID:               30535
 Updated by:       [EMAIL PROTECTED]
 Reported By:      smadeira at zoominternet dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         Arrays related
 Operating System: Linux 2.4.20-8
 PHP Version:      4.3.9
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Can't reproduce - your code produces the very expected result (tried
all dev versions).


Previous Comments:
------------------------------------------------------------------------

[2004-10-22 21:10:23] smadeira at zoominternet dot net

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 )


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30535&edit=1

Reply via email to