#50152 [Opn->Asn]: ReflectionClass::hasPropertys hehaves like isset() not property_exists

From: Date: Wed, 11 Nov 2009 18:39:52 +0000
Subject: #50152 [Opn->Asn]: ReflectionClass::hasPropertys hehaves like isset() not property_exists
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144485@lists.php.net to get a copy of this message
ID: 50152 Updated by: felipe@php.net Reported By: felipe@php.net -Status: Open +Status: Assigned Bug Type: Reflection related Operating System: Linux PHP Version: 5.3SVN-2009-11-11 (SVN) -Assigned To: +Assigned To: felipe Previous Comments: ------------------------------------------------------------------------ [2009-11-11 18:39:41] felipe@php.net Description: ------------ This change looks to be introduced accidentaly in HEAD, and was MFHd by me times ago. the hasProperty() is currently using the __isset magic method, this doesn't look right from a reflection perspective. It must behaves like property_exists() that doesn't uses the magic stuff. Reproduce code: --------------- <?php class foo { function __isset($a) { var_dump($a); return 1; } } $x = new foo; $ref = new ReflectionObject($x); var_dump($ref->hasProperty('b')); Expected result: ---------------- bool(false) Actual result: -------------- string(1) "b" bool(true) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50152&edit=1

« previous php.bugs (#144485) next »