Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23942 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97696 invoked by uid 1010); 4 Jun 2006 16:15:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97681 invoked from network); 4 Jun 2006 16:15:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2006 16:15:56 -0000 X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:33103] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id D8/BE-49656-B3703844 for ; Sun, 04 Jun 2006 12:15:55 -0400 Received: from baumbart.mbo (dslb-084-063-038-098.pools.arcor-ip.net [84.63.38.98]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id CB31D35C1E2; Sun, 4 Jun 2006 18:15:51 +0200 (CEST) Date: Sun, 4 Jun 2006 18:15:51 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <254501968.20060604181551@marcus-boerger.de> To: Stanislav Malyshev Cc: Andi Gutmans , internals@lists.php.net In-Reply-To: References: <795156743.20060603134212@marcus-boerger.de> <7.0.1.0.2.20060603175211.02208a50@zend.com> <20060604030100.1093d2f9@pierre-u64> <7.0.1.0.2.20060603181129.0396fc18@zend.com> <44823B41.5000608@akbkhome.com> <44823C51.7040408@lerdorf.com> <64299052.20060604120852@marcus-boerger.de> <20060604135241.3beacb32@pierre-u64> <1853717276.20060604140317@marcus-boerger.de> <1912643046.20060604141822@marcus-boerger.de> <7.0.1.0.2.20060604071847.03b74850@zend.com> <1834492302.20060604165624@marcus-boerger.de> <7.0.1.0.2.20060604075725.03d77b20@zend.com> <1996647038.20060604170829@marcus-boerger.de> <7.0.1.0.2.20060604081244.03dcd938@zend.com> <334553601.20060604171820@marcus-boerger.de> <7.0.1.0.2.20060604083527.034ae330@zend.com> <866332952.20060604175205@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Missing __toString() part From: helly@php.net (Marcus Boerger) Hello Stanislav, ok, that was good explanation, thanks. best regards marcus Sunday, June 4, 2006, 6:02:33 PM, you wrote: MB>>>typedef struct _zend_object_value { MB>>> zend_object_handle handle; MB>>> zend_object_handlers *handlers; MB>>>} zend_object_value; MB>>> MB>>>And wouldn't it be faster to drop both handlers from the table and MB>>>instead have zend_object_value have a pointer to zend_class_entry MB>>>and that a pounter to the handler table? > Not quite - since not all objects have zend_class_entry for them so you > couldn't actually use it - unless you insert check each time _and_ write > code to handle _both_ cases - using zend_class_entry pointer and using > something else - so it's actually easier to do the right thing from the > start and use the handlers. Of course, you could "optimize" it for the > case zend_class_entry exists and add the zend_class_entry field into the > object value - but IMHO the resulting code and model complication would do > much more harm than speed improvement on saving one function call (which > I'm not sure is of any significance). Also, this would inevitably lead to > creating code which forgets to use handlers and breaks in all kinds of > funny ways on overloaded objects. My opinion is that it is better to have > one consistent API. > As for the question why there are two handlers - because class name is > useful in all kinds of contexts like backtaces, exceptions, messages, etc. > even though you may not have zend_class_entry - so it's a possibility for > the overloaded object to give maximum iformation there. > -- > Stanislav Malyshev, Zend Products Engineer > stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115 Best regards, Marcus