From:             spam04 at pornel dot net
Operating system: *
PHP version:      5.3SVN-2009-11-11 (snap)
PHP Bug Type:     Reflection related
Bug description:  property_exists: Closure object cannot have properties

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"

-- 
Edit bug report at http://bugs.php.net/?id=50146&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50146&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50146&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50146&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50146&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50146&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50146&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50146&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50146&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50146&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50146&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50146&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50146&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50146&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50146&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50146&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50146&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50146&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50146&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50146&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50146&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50146&r=mysqlcfg

Reply via email to