Re: Adding a few debug helpers to php4.x

From: Date: Wed, 03 Mar 2004 09:25:32 +0000
Subject: Re: Adding a few debug helpers to php4.x
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-8333@lists.php.net to get a copy of this message
On Tue, 2004-03-02 at 20:49, Todd Ruth wrote: > I work for a company that is using php and would like to > contribute a few helper functions that we find useful. > They are most helpful for anyone doing OO work (especially > if using singletons) who isn't ready to move to php5. > Two of the three are trivial to incorporate, but > for the third I'm looking for some advice. I'm also not > sure if I should get a cvs account for this stuff or > if posting it here is sufficient inspiration for some > good natured soul to get the functions into php. :) > I'll start with the easy ones: > > ============ ref_id(mixed var) ============ [snip] > ============ ref_count(mixed var) ============ I agree that these could be quite useful, I just ran into a situation a few minutes ago where they would have saved me some time. > ============ (dis)allow_copies(mixed var) ============ What about implementing this directly in php? You could use trigger_error in the constructor to stop the script from executing if the object is instantiated more than once. -- Adam Bregenzer adam@bregenzer.net http://adam.bregenzer.net/

« previous php.internals (#8333) next »