|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-11 18:59 UTC] felipe@php.net
[2009-11-11 18:59 UTC] svn@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
Description: ------------ property_exists() rejects closures with "Closure object cannot have properties" rather than simply always returning false. Since closures pass is_object() test, it's hard to avoid this error without testing for "instanceof Closure" as well, which is discouraged in the docs. Reproduce code: --------------- $obj = function(){} is_object($obj) && property_exists($obj,'foo'); Expected result: ---------------- false (either they should not be considered objects, or property_exists should accept any object). Actual result: -------------- "Closure object cannot have properties"