Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23937 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86036 invoked by uid 1010); 4 Jun 2006 15:52:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86020 invoked from network); 4 Jun 2006 15:52:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2006 15:52:09 -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:33047] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 2B/EC-49656-8A103844 for ; Sun, 04 Jun 2006 11:52:09 -0400 Received: from baumbart.mbo (dslb-084-063-007-047.pools.arcor-ip.net [84.63.7.47]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id D053135C1E2; Sun, 4 Jun 2006 17:52:05 +0200 (CEST) Date: Sun, 4 Jun 2006 17:52:05 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <866332952.20060604175205@marcus-boerger.de> To: Stanislav Malyshev Cc: Andi Gutmans , internals@lists.php.net In-Reply-To: References: <795156743.20060603134212@marcus-boerger.de> <509342741.20060603183859@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> 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, do you remember any reason why we have the current layout with the zval pointing to a handler and that having a function which returns a pointer to the class_entry as well as a function that returns the name? struct _zend_object_handlers { [...] zend_object_get_class_entry_t get_class_entry; zend_object_get_class_name_t get_class_name; typedef struct _zend_object_value { zend_object_handle handle; zend_object_handlers *handlers; } zend_object_value; And wouldn't it be faster to drop both handlers from the table and instead have zend_object_value have a pointer to zend_class_entry and that a pounter to the handler table? best regards marcus Sunday, June 4, 2006, 5:42:02 PM, you wrote: AG>>>We should probably make this a requirement and I don't know of one AG>>>today that doesn't have an associated class name. I believe some parts AG>>>of PHP might blow up if this isn't supported. > There are parts that can blow up if get_class_name is NULL or returns NULL > (though good practice would be to filter such places out but I'm not sure > it was ever accomplished) - however it doesn't have to be NULL to be a > problem. Imagine two extensions that bridge external objects - e.g., Java > and .Net one - that attempt to return real class of an object, but if it > doesn't succeed (e.g., internal reflection doesn't work for some reason) > they return "???" instead. It's not that good, but we can't catch it and > we can't even put up a requirement out saying "your 'don't know' value > should be different from other's" - how's one supposed to know what > other's value is? And if you don't do something very unrelated would break > in very strange ways - so it's be quite hard even point to what is the > cause. > So in fact classname here would not be a good idea for ID. Handler table, > however, combined with object handle seems to be good way to ID an object > - it's how the engine identifies them after all... Best regards, Marcus