php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44857 no property_exists() equivalent for magic properties
Submitted: 2008-04-28 18:05 UTC Modified: -
Votes:14
Avg. Score:4.5 ± 0.8
Reproduced:13 of 13 (100.0%)
Same Version:4 (30.8%)
Same OS:5 (38.5%)
From: mike at silverorange dot com Assigned:
Status: Open Package: Feature/Change Request
PHP Version: 5.2.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mike at silverorange dot com
New email:
PHP Version: OS:

 

 [2008-04-28 18:05 UTC] mike at silverorange dot com
Description:
------------
There is currently no way to determine if a magic __get() property exists.

The __isset() function should use 'isset(null) == false' semantics so it cannot be used to reliably check if a magic property exists.

I propose a new magic method __property_exists($name) or __propertyExists($name) be created that hooks into the property_exists() function. It would return true iff __get($name) returns any value.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Aug 12 19:01:26 2020 UTC