Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92682 invoked from network); 7 Jan 2013 18:34:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jan 2013 18:34:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=nathan.bruer@starin.biz; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=nathan.bruer@starin.biz; sender-id=unknown Received-SPF: error (pb1.pair.com: domain starin.biz from 207.198.105.69 cause and error) X-PHP-List-Original-Sender: nathan.bruer@starin.biz X-Host-Fingerprint: 207.198.105.69 hawk.starindns.com Received: from [207.198.105.69] ([207.198.105.69:46227] helo=hawk.starindns.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/83-08897-F451BE05 for ; Mon, 07 Jan 2013 13:34:55 -0500 Received: from 173-167-160-145-illinois.hfc.comcastbusiness.net ([173.167.160.145]:54815 helo=NathanBruerHP) by hawk.starindns.com with esmtpa (Exim 4.80) (envelope-from ) id 1TsHX9-00064p-Jf; Mon, 07 Jan 2013 12:34:51 -0600 Sender: "Nathan Bruer" To: "'Derick Rethans'" Cc: References: <102501cdecf9$e427d540$ac777fc0$@starin.biz> In-Reply-To: Date: Mon, 7 Jan 2013 12:34:45 -0600 Message-ID: <105701cded05$ab265d50$017317f0$@starin.biz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKTTb41s2Ci8Xiky5YVVwJBi0tU0wGj6m/NlqY+S5A= Content-Language: en-us X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hawk.starindns.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - starin.biz X-Get-Message-Sender-Via: hawk.starindns.com: authenticated_id: nathan.bruer@starin.biz Subject: RE: [PHP-DEV] new Class ReflectionZVal From: nathan@starin.biz From: Derick Rethans [mailto:derick@php.net] Sent: Monday, January 07, 2013 11:22 AM To: nathan@starin.biz Cc: internals@lists.php.net Subject: Re: [PHP-DEV] new Class ReflectionZVal On Mon, 7 Jan 2013, nathan@starin.biz wrote: >> function __construct(&$variable); > That's inherently flawed, as passing a variable in can modify it's refcount and is_ref states. This is why Xdebug's equivalent wants a string with the variable name instead: > http://xdebug.org/docs/all_functions#xdebug_debug_zval I am quite familiar with this issue. The idea I was thinking to solve that issue is to maybe pass by-reference to the __construct. When I was drafting this first email I had it by-ref, but opted out of it because I didn't have a way to get the value of the reference, but reviewing I added the " function getValueReflection();" functions which should make it possible to use by-reference now and obtain the info to the reference of the reference. >> function valueExists(); > What's a "referenced variable" here? If you pass in something, it will exist. The idea is that the value may not exist. This function would confirm that the value of the reflected zval still exists. My first draft of this email only had "function &getValue();" but I think it would create problems if it stated something like, "Returns null if value does not exist" because what if the value does exist (ie variable reference is still alive) but the value is null? This function (ReflectionZVal::valueExists()) would return false if the zval is gone (garbage collected).