PHP Classes

The destructor trick is really impressive, nice work! But sho...

Recommend this page to a friend!

      Java and C# compatible object autoboxing for PHP  >  All threads  >  The destructor trick is really...  >  (Un) Subscribe thread alerts  
Subject:The destructor trick is really...
Summary:Package rating comment
Messages:4
Author:Fabian Schmengler
Date:2010-11-04 10:19:51
Update:2010-12-20 20:17:26
 

Fabian Schmengler rated this package as follows:

Utility: Good
Consistency: Sufficient
Examples: Good

  1. The destructor trick is really...   Reply   Report abuse  
Picture of Fabian Schmengler Fabian Schmengler - 2010-11-04 10:19:51
The destructor trick is really impressive, nice work! But shouldn't it be possible without flooding the global namespace? Like storing the references in a static array?

  2. Re: The destructor trick is really...   Reply   Report abuse  
Picture of Artur Graniszewski Artur Graniszewski - 2010-11-04 10:52:21 - In reply to message 1 from Fabian Schmengler
Yes, you're correct, this flooding can be easily fixed. This "global" behaviour is the code because of the old times: when I wrote the class back in 2008 i've done this quick dirty trick just to test if it's even possible to do the autoboxing (and I've forgot to fix that later).

  3. Re: The destructor trick is really...   Reply   Report abuse  
Picture of Artur Graniszewski Artur Graniszewski - 2010-11-04 10:57:55 - In reply to message 2 from Artur Graniszewski
Please also note, that this class is rather a PoC (Proof of Concept) rather than a full scale bussiness ready solution. I did wrote about this in my class description, but it has been changed by the site administrator.

I've stripped this mechanism from my framework which heavily uses this solution for and datatype security enforcement and UTF-8 Strings (see my "Java compatible UTF-8 string class" on phpclasses - which is also stripped from this mechanism but can be easily reimplemented)

  4. Re: The destructor trick is really...   Reply   Report abuse  
Picture of Artur Graniszewski Artur Graniszewski - 2010-12-20 20:17:26 - In reply to message 1 from Fabian Schmengler
Ok, i've fixed this problem. Now everything is in VariablesManager class.