Bug #7765 Updated: not OO until automatic class destructor is added
| From: | shelby at DownloadFAST dot com | Date: | Tue, 23 Oct 2001 18:42:22 +0000 |
| Subject: | Bug #7765 Updated: not OO until automatic class destructor is added | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68871@lists.php.net to get a copy of this message | ||
ID: 7765
User updated by: shelby@DownloadFAST.com
Reported By: shelby@DownloadFAST.com
Status: Open
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 4.0.3pl1
New Comment:
Thank you for keeping my feature request alive.
If I remember the discussions correctly, the implementation issue boiled down to the fact that PHP
does not kill local variables at function or block termination (for speed reasons I believe). In
order to properly implement a destructor, the reference count for a variable needs to be decremented
as the block scope of the declaration is exited.
I had suggested that this be a compile time flag, because correct program behavior is to do the
reference decrements on block exit. For those of us who want every possible tool to illuminate bugs
(e.g. error_reporting( E_ALL)), this just adds another level of error checking on use of such
constructs as global references on local variables, etc.
Again, perhaps this is not the main focus of PHP, but nevertheless I think it would be helpful
option for developers who are writing huge OO sites with PHP. It seems the incidence of such has
increased greatly since I first made this report.
BTW, I do not know how my original comments got deleted. I hope my memory of the issues is correct
herein. Apologies if I am mistaken.
Please take my comments constructively.
Previous Comments:
------------------------------------------------------------------------
[2001-10-23 13:54:34] shelby@DownloadFAST.com
Thank you for keeping my feature request alive.
If I remember the discussions correctly, the implementation issue boiled down to the fact that PHP
does not kill local variables at function or block termination (for speed reasons I believe). In
order to properly implement a destructor, the reference count for a variable needs to be decremented
as the block scope of the declaration is exited.
I had suggested that this be a compile time flag, because correct program behavior is to do the
reference decrements on block exit. For those of us who want every possible tool to illuminate bugs
(e.g. error_reporting( E_ALL)), this just adds another level of error checking on use of such
constructs as global references on local variables, etc.
Again, perhaps this is not the main focus of PHP, but nevertheless I think it would be helpful
option for developers who are writing huge OO sites with PHP. It seems the incidence of such has
increased greatly since I first made this report.
BTW, I do not know how my original comments got deleted. I hope my memory of the issues is correct
herein. Apologies if I am mistaken.
Please take my comments constructively.
------------------------------------------------------------------------
[2001-10-21 19:10:19] sniper@php.net
Couldn't find the information about for which report
this was duplicate. And this is feature reques.
------------------------------------------------------------------------
[2000-11-12 03:20:26] shelby@DownloadFAST.com
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=7765&edit=1