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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to