Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49904 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70083 invoked from network); 13 Oct 2010 07:00:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2010 07:00:46 -0000 Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 74.125.82.170 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:35226] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/EA-60583-C1955BC4 for ; Wed, 13 Oct 2010 03:00:45 -0400 Received: by wyb36 with SMTP id 36so35236wyb.29 for ; Wed, 13 Oct 2010 00:00:42 -0700 (PDT) Received: by 10.227.20.16 with SMTP id d16mr2679471wbb.156.1286953242060; Wed, 13 Oct 2010 00:00:42 -0700 (PDT) Received: from pc ([83.228.56.37]) by mx.google.com with ESMTPS id x6sm436641weq.37.2010.10.13.00.00.40 (version=SSLv3 cipher=RC4-MD5); Wed, 13 Oct 2010 00:00:41 -0700 (PDT) Message-ID: <8C81F534A6C3449E9D81D0B157C2052E@pc> To: "Stas Malyshev" Cc: References: <4CB492BE.2090305@sugarcrm.com> Date: Wed, 13 Oct 2010 10:00:38 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1251"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Subject: Re: [PHP-DEV] Process failed? BC and use cases for property_exists() broken in PHP 5.3 From: sv_forums@fmethod.com ("Stan Vass") > Hi! > >> 3) The use case for this function required the existing behavior >> (i.e. can you safely call property $x from the current scope with no >> warning?), and that *ignored* when the behavior was changed. We >> already have Reflection classes for inquiring protected/private >> properties of a class from any scope. > > Maybe we can fix this by having an argument to the function that if > false, checks only for existence, and if true, checks also for access? > > On the other hand, we already have isset() for vars and is_callable() > for methods, so this use case might to be covered. > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 A flag seems like a viable solution, but I'm worried that something that was flagged as a "bug", was not, and caused change in docs, tests and behavior, while all agreed with each other before. This is at beast a "feature request" which should have been discussed as such, considering BC break implications and so forth. As for isset(), it doesn't cover the use case for property_exists(), as isset() returns false when a property exists, and is one of these values: null, false, int 0, float 0, string '', empty array() property_exists() more closely relates to "array_key_exists() for objects" in that regard. Stan Vass