|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2010-11-20 13:45 UTC] 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
I mistyped the last line on Test script : $reflect->getProperty('property1'); // breaks$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