ID: 37144
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5.1.2
Assigned To: dmitry
New Comment:
Fixed in CVS HEAD and PHP_5_2.
Previous Comments:
------------------------------------------------------------------------
[2006-04-20 16:58:10] [EMAIL PROTECTED]
PHP always segfaults with this script if it is compied with
--enable-debug.
------------------------------------------------------------------------
[2006-04-20 13:09:18] smlerman at gmail dot com
I don't get a segfault on Windows 5.1.1, Linux 5.1.1 (compiled on
Ubuntu), or Linux 5.1.2 (compiled on Fedora).
As a side note, should that even be valid syntax? Shouldn't the left
side of assignment only allow variables (other than the special
language construct list())? Isn't foo()->bar[1] an expression, not a
variable?
------------------------------------------------------------------------
[2006-04-20 08:30:53] [EMAIL PROTECTED]
Description:
------------
PHP removes a temorary object then tryes to assign into its property.
As a result we have SIGSEGV.
Reproduce code:
---------------
<?php
function foo() {
$x = new stdClass();
$x->bar = array(1);
return $x;
}
foo()->bar[1] = "123";
echo "ok\n";
?>
Expected result:
----------------
ok
Actual result:
--------------
crash and/or memory leaks
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37144&edit=1