Edit report at http://bugs.php.net/bug.php?id=53366&edit=1
ID: 53366 Updated by: fel...@php.net Reported by: jorgevpinho at gmail dot com Summary: Reflection doesnt get dynamic property value from getProperty() -Status: Open +Status: Closed Type: Bug Package: Reflection related Operating System: WinXP SP3 PHP Version: 5.2.13 -Assigned To: +Assigned To: felipe Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2010-11-20 23:53:57] fel...@php.net Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=305589 Log: - Fixed bug #53366 (Reflection doesnt get dynamic property value from getProperty()) ------------------------------------------------------------------------ [2010-11-20 15:47:52] jorgevpinho at gmail dot com $reflect = new ReflectionObject($myClass); $prop = $reflect->getProperty('property1'); echo($prop->getValue()); // Warning: ReflectionProperty::getValue() expects exactly 1 parameter // doc says its not mandatory echo($prop->getValue($myClass)); // no error, but nothing happens and no value is returned ------------------------------------------------------------------------ [2010-11-20 15:04:13] fel...@php.net And using ReflectionObject instead? ------------------------------------------------------------------------ [2010-11-20 13:47:25] jorgevpinho at gmail dot com I mistyped the last line on Test script : $reflect->getProperty('property1'); // breaks ------------------------------------------------------------------------ [2010-11-20 13:45:05] jorgevpinho at gmail dot com Description: ------------ --- >From manual page: http://www.php.net/reflectionclass.getproperties --- Test script: --------------- class UserClass { } $myClass = $mysqli_rs->fetch_object("UserClass"); $reflect = new ReflectionClass($myClass); echo($myClass->property1); //works $reflect->getProperty('titulo'); // breaks Expected result: ---------------- no error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53366&edit=1