Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3271 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83392 invoked from network); 6 Jul 2003 10:27:04 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.189) by pb1.pair.com with SMTP; 6 Jul 2003 10:27:04 -0000 Received: from [212.227.126.161] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 19Z6jX-0001fk-00 for internals@lists.php.net; Sun, 06 Jul 2003 12:27:03 +0200 Received: from [80.137.188.131] (helo=phpdoc.de) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 19Z6jX-0006wW-00 for internals@lists.php.net; Sun, 06 Jul 2003 12:27:03 +0200 Message-ID: <3F07F974.2010108@phpdoc.de> Date: Sun, 06 Jul 2003 12:27:00 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a) Gecko/20030401 X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: destructor access to constants From: ulf.wendel@phpdoc.de (Ulf Wendel) Hi, I'm wondering if it's a bug to give automatically called destructors access to constants (PHP Version 5.0.0b1). I'd expect to be neither able to access global variables nor constants after script termination (die()). Ulf $dtor = 'global $dtor variable is visible'; define('DTOR', 'DTOR constant is visible'); class dtor { function __destruct() { global $dtor; printf('$dtor = "%s"
DTOR = "%s"
', $dtor, DTOR); } } $d1 = new dtor(); unset($d1); $d2 = new dtor(); die(); generated output: $dtor = "global $dtor variable is visible" DTOR = "DTOR constant is visible" $dtor = "" DTOR = "DTOR constant is visible"