Edit report at https://bugs.php.net/bug.php?id=63591&edit=1

 ID:                 63591
 Updated by:         re...@php.net
 Reported by:        HMWiesinger at gmx dot at
 Summary:            Can't write to properties of mysqli classes using
                     Reflection API
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            MySQLi related
 Operating System:   Linux
 PHP Version:        5.4.9
 Block user comment: N
 Private report:     N

 New Comment:

affected_rows property is kinda readonly property, so we can't change
that with reflection apis or property value update. 

it makes the property reliable, I don't see a reason to change that,
I you really need to do that inherit it with a subclass.


Previous Comments:
------------------------------------------------------------------------
[2012-11-23 20:07:34] HMWiesinger at gmx dot at

Description:
------------
It doesn't seem to be possible to get write access to properties of mysqli 
classes 
using the Reflection API. 



Test script:
---------------
$mysqli = new MySQLi();
$reflection = new ReflectionClass('\MySQLi');

$property = $reflection->getProperty('affected_rows');
$property->setAccessible(TRUE);
$property->setValue($mysqli, 10);


Expected result:
----------------
No Error

Actual result:
--------------
Fatal error: ReflectionProperty::setValue(): Cannot write property


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63591&edit=1

Reply via email to