#29098 [NEW]: "new" operator crashes script

From: Date: Sun, 11 Jul 2004 18:35:33 +0000
Subject: #29098 [NEW]: "new" operator crashes script
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-62041@lists.php.net to get a copy of this message
From: antonr at game dot permonline dot ru Operating system: WinXP Pro SP1 PHP version: 5CVS-2004-07-11 (dev) PHP Bug Type: Reproducible crash Bug description: "new" operator crashes script Description: ------------ When "new" operator appears without "=" operator, it is possibly crashes php Reproduce code: --------------- <?php class ParentClass { private $child; public function __construct($child) { echo "ParentClass::__construct()<br>\n"; $this->child = $child; $child->setParent($this); } public function __destruct() { echo "ParentClass::__destruct()<br>\n"; unset($this->child); } } class ChildClass { private $parent; public function setParent($parent) { echo "ChildClass::setParent()<br>\n"; $this->parent = $parent; } public function __destruct() { echo "ChildClass::__destruct()<br>\n"; unset($this->parent); } } new ParentClass(new ChildClass()); ?> Expected result: ---------------- ParentClass::__construct() ChildClass::setParent() and possibly ChildClass::__destruct() ParentClass::__destruct() Actual result: -------------- php crashes -- Edit bug report at http://bugs.php.net/?id=29098&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29098&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29098&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29098&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29098&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29098&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29098&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29098&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29098&r=support Expected behavior: http://bugs.php.net/fix.php?id=29098&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29098&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29098&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29098&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29098&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29098&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29098&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29098&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29098&r=float

« previous php.bugs (#62041) next »