Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49563 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 953 invoked from network); 3 Sep 2010 11:38:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2010 11:38:03 -0000 X-Host-Fingerprint: 78.142.172.145 gate-g21.inqnet.at Received: from [78.142.172.145] ([78.142.172.145:6085] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/21-27233-A1ED08C4 for ; Fri, 03 Sep 2010 07:38:02 -0400 Message-ID: <2B.21.27233.A1ED08C4@pb1.pair.com> To: internals@lists.php.net Date: Fri, 03 Sep 2010 13:37:58 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Lanikai/3.1.2 MIME-Version: 1.0 References: <81.35.47051.C61C08C4@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 78.142.172.145 Subject: Re: [PHP-DEV] Re: remove or fix zend_object_proxies From: mike@php.net (Michael Wallner) On 09/03/2010 01:20 PM, Pierre Joye wrote: > hehe, I did not mean that this mail was offensive. Only that this > stuff is the best way to get mad at php internals. A more verbose post > would help to, what's your actual proposal/wish or an example case :) Alright then. OBJECTS2_HOWTO--okay maybe a tiny bit out of date, but nevertheless--states that for the get_property_ptr_ptr object handler, which is supposed to return zval** of the property, one can use zend_proxy_objects for properties not really existing as zvals. This objects overload the get and set object handlers (note: not __get/__set) to enable something along the lines: class user_class extends internal_class { function method() { $ref = &$this->internal_property; /* $ref now actually is a zend_proxy_object */ $ref = 1; } } ... but no other object handler that add_ref, del_ref, clone_obj, get and set are defined, which causes everything from fatal errors to SEGVs on simple statements like var_dump, echo, (string)-cast etc... Additionally on object destruction, at the latest on shutdown, (the default) zend_objects_destroy_object causes a SEGV because zend_proxy_objects actually are not zend_objects and don't have a class entry. Hrm.. after re-reading this mail, I don't think it's more comprehensive than the first one... ;) Mike