Re: Process failed? BC and use cases for property_exists() broken in PHP 5.3

From: Date: Wed, 13 Oct 2010 07:00:38 +0000
Subject: Re: Process failed? BC and use cases for property_exists() broken in PHP 5.3
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-49904@lists.php.net to get a copy of this message
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

« previous php.internals (#49904) next »