#37144 [Asn]: PHP crashes trying to assign into property of dide object

From: Date: Thu, 20 Apr 2006 16:58:11 +0000
Subject: #37144 [Asn]: PHP crashes trying to assign into property of dide object
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96048@lists.php.net to get a copy of this message
ID: 37144 Updated by: dmitry@php.net Reported By: dmitry@php.net Status: Assigned Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.1.2 Assigned To: dmitry New Comment: PHP always segfaults with this script if it is compied with --enable-debug. Previous Comments: ------------------------------------------------------------------------ [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] dmitry@php.net 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

« previous php.bugs (#96048) next »