Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8333 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75883 invoked by uid 1010); 3 Mar 2004 09:25:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75859 invoked from network); 3 Mar 2004 09:25:25 -0000 Received: from unknown (HELO mail5.speakeasy.net) (216.254.0.205) by pb1.pair.com with SMTP; 3 Mar 2004 09:25:25 -0000 Received: (qmail 26388 invoked from network); 3 Mar 2004 09:25:24 -0000 Received: from dsl027-161-088.atl1.dsl.speakeasy.net (HELO arcon_server.internal.bregenzer.net) ([216.27.161.88]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 3 Mar 2004 09:25:24 -0000 To: truth@proposaltech.com Cc: internals@lists.php.net In-Reply-To: <1078278552.17703.234.camel@notebook.local> References: <1078278552.17703.234.camel@notebook.local> Content-Type: text/plain Message-ID: <1078305931.6596.38.camel@arcon_server> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 03 Mar 2004 04:25:32 -0500 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Adding a few debug helpers to php4.x From: adam@bregenzer.net (Adam Bregenzer) 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/