Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6181 invoked from network); 23 Mar 2003 05:52:57 -0000 Received: from unknown (HELO imf46bis.bellsouth.net) (205.152.58.95) by pb1.pair.com with SMTP; 23 Mar 2003 05:52:57 -0000 Received: from k4z4b4 ([67.33.125.205]) by imf46bis.bellsouth.net (InterMail vM.5.01.04.25 201-253-122-122-125-20020815) with SMTP id <20030323055501.SGEM3346.imf46bis.bellsouth.net@k4z4b4> for ; Sun, 23 Mar 2003 00:55:01 -0500 Message-ID: <02c301c2f100$76fef6b0$4575fea9@k4z4b4> To: Date: Sun, 23 Mar 2003 00:53:01 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: Re: default exceptions, interfaces, etc. From: cshmoove@bellsouth.net ("l0t3k") Sterling, have you thought of public accessors (maybe even macros) for exception properties. this is for the benefit of extension authors who want to subclass. right now i have to basically copy the code for the constructor to my new class, or resort using call_user_function_ex. for my extension classes i usually do something like this : int myclass_init_zval(zval *return_val,int foo, char *bar, void *etc); /* create a myclass obj stored in return_val */ and put it in the header so i can create an instance of the class from anywhere i need to. the constructor function also calls this. another idea is basic macros /* set up the common properties. subclasses can add others. also set EG(exception) to return_zval if not set */ ZEND_RAISE_EXCEPTION_EX(return_zval, exception_or_subclass_ce, code, message, ...) /* for extension authors to handle exceptions in C */ ZEND_LOWER_EXCEPTION() /* just to be less arcane */ ZEND_HAS_EXCEPTION() (NULL != EG(exception))