From: eric at cosky dot com Operating system: Windows XP SP1 PHP version: 5CVS-2003-07-13 (dev) PHP Bug Type: Reproducible crash Bug description: small block of code causes crash, possibly destructor related.
Description: ------------ The following block of code will crash the PHP I installed from php5-win32-200307130630.zip (and previous versions). I've read that I should be using '&new' to gain proper use of destructors, but it seems reasonable to say that using 'new' shouldn't cause a server crash. Perhaps a useful thing to do would be to have a class that has a __destruct() function produce an error if created without '&new'? Reproduce code: --------------- class SiteClass { function __construct() { $this->page = new PageClass(); } } class PageClass { function Display() { $section = new SectionClass("PageClass::Display"); } } class SectionClass { function __construct($comment) { $this->Comment = $comment; } function __destruct() { out($this->Comment); // this line doesn't crash PHP out("\n<!-- End Section: " . $this->Comment . "-->"); // this line crashes PHP } } function out($code) { return; } $site = new SiteClass(); $site->page->Display(); Expected result: ---------------- Nothing. Actual result: -------------- System alert for PHP crashing. -- Edit bug report at http://bugs.php.net/?id=24635&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24635&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24635&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24635&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24635&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24635&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24635&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24635&r=support Expected behavior: http://bugs.php.net/fix.php?id=24635&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24635&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24635&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24635&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24635&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24635&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24635&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24635&r=gnused