Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85236 invoked by uid 1010); 30 Jan 2006 05:51:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85221 invoked from network); 30 Jan 2006 05:51:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2006 05:51:45 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:46952] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 3A/45-37522-079ADD34 for ; Mon, 30 Jan 2006 00:51:44 -0500 Received: from [192.168.11.3] (c-24-6-96-18.hsd1.ca.comcast.net [24.6.96.18]) (authenticated bits=0) by colo.lerdorf.com (8.13.5/8.13.5/Debian-3) with ESMTP id k0U5pdbX008690; Sun, 29 Jan 2006 21:51:40 -0800 In-Reply-To: <43DA4E9F.8050908@ctindustries.net> References: <43DA4E9F.8050908@ctindustries.net> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <17BE1EF3-68F9-4121-B32F-95B6E2925B03@gravitonic.com> Cc: "internals@lists.php.net" Content-Transfer-Encoding: 7bit Date: Sun, 29 Jan 2006 21:51:40 -0800 To: Rob Richards X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: ClamAV 0.88/1257/Sun Jan 29 07:15:47 2006 on colo X-Virus-Status: Clean Subject: Re: [PHP-DEV] crashing due to get_properties handler From: andrei@gravitonic.com (Andrei Zmievski) I've run into the same thing with PHP-GTK. While Zend engine itself may check for existence of handler, PHP code does not. -Andrei On Jan 27, 2006, at 8:47 AM, Rob Richards wrote: > Is it required that the get_properties handler be implemented for > an object? > > In the source there are places that it tests if it is implemented > and then tests the returned value in the event it is NULL. > The problem is that this is not consistent throughout the zend and > php source and I'm getting crashes on certain calls. > > For example: > calling var_dump in var.c: Z_OBJPROP_PP is used without testing if > implemented so the handler is required otherwise crash. > get_object_vars in zend_builtin_functions.c: checks to see if it > is implemented, but doesn't test the return value in the case of NULL. > > I assume checks for both the handler existing and the return value > possibly being NULL are what should be used throughout the code, > but wanted to check on that first. > > Rob > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php