From:             Webbed dot Pete at gmail dot com
Operating system: Linux
PHP version:      5.2.1
PHP Bug Type:     Reproducible crash
Bug description:  500 Server Error on array_merge of func return

Description:
------------
If I do 
{ 
  $from=getarray();
  $tgt=array_merge($to,$from); 
} 
all is well. But if I do 
{
  $tgt=array_merge($to,getarray());
}
then the page blows up with a 500 internal server error (and getarray() is
never called). 
I can't (yet) duplicate this as a simple test case; it only happens in the
middle of a large site source base.

This is on an Apache server (1.3.37) with PHP 5.2.1 running as CGI.

The *really* painful part is the 500 Internal Server Error, with no PHP
error messages of any kind. Made it incredibly painful to track this down
;)

Reproduce code:
---------------
See above. I've not yet got a simple test case. All of the following
produce the 500 error:

  $tgt=array_merge($to,getarray());
  $tgt=array_merge($to,$from=getarray());
  $tgt=array_merge($to,(array)getarray());

Only if the getarray() call is outside the array_merge() does it succeed.

Expected result:
----------------
a) No error

b) Better debugability of 500 Internal Server Errors caused by PHP


Actual result:
--------------
500 Internal Server Error with no other message.

-- 
Edit bug report at http://bugs.php.net/?id=40967&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40967&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40967&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40967&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40967&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40967&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40967&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40967&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40967&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40967&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40967&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40967&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40967&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40967&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40967&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40967&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40967&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40967&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40967&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40967&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40967&r=mysqlcfg

Reply via email to