#27819 [Opn->Csd]: Returning a reference to a reference parameter more than once causes crash
ID: 27819
Updated by: iliaa@php.net
Reported By: php at mirzabah dot com
-Status: Open
+Status: Closed
Bug Type: Reproducible crash
Operating System: Windows XP
PHP Version: 4.3.4
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-03-31 22:42:00] php at mirzabah dot com
Description:
------------
If a variable is passed by reference to a function that returns it as a
reference more than once, PHP will hang then crash on exit. I'm
guessing it's some kind of garbage collection problem...
Reproduce code:
---------------
<html>
<head><title>Ref Test</title></head>
<body>
<h1>Ref Test</h1>
<?
$a = 6 ;
echo "<p>{$a}</p>\n" ;
$a =& modify ($a) ;
echo "<p>{$a}</p>\n" ;
$a =& modify ($a) ;
?>
</body>
</html><?
function &modify (&$thing)
{
$thing += 1 ;
return $thing ;
}
?>
Expected result:
----------------
I expect PHP to exit cleanly upon completion of the script.
Actual result:
--------------
When the script finishes execution, it hangs and eventually crashes.
Note that the function returns cleanly as often as you call it. The
hang only occurs once the script has completed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27819&edit=1
Thread (2 messages)