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

I don't have the ability to run a Linux snapshot since the account is
hosted.  I loaded the code here:
http://kidsportsoftware.com/datebug.php so you can see it in action. 
You can also run phpinfo from here as:
http://kidsportsoftware.com/phpinfo.php to see how the hosting account
is configured.

I tried a Windows snapshot (4.3.10-dev) and it does work properly on
Windows.


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

[2004-10-23 08:22:44] [EMAIL PROTECTED]

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).

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

[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