|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits              [2015-06-12 01:33 UTC] laruence@php.net
 
-Assigned To:
+Assigned To: laruence
  [2015-06-12 01:33 UTC] laruence@php.net
  [2015-06-13 13:31 UTC] laruence@php.net
 
-Type:        Bug
+Type:        Documentation Problem
-Assigned To: laruence
+Assigned To:
  [2015-06-13 13:31 UTC] laruence@php.net
 
-Status: Open
+Status: Assigned
  [2015-06-13 22:09 UTC] grzegorz129 at gmail dot com
  [2015-06-13 23:13 UTC] bwoebi@php.net
 
-Status:      Open
+Status:      Assigned
-Type:        Documentation Problem
+Type:        Bug
-Assigned To:
+Assigned To: laruence
  [2015-06-13 23:13 UTC] bwoebi@php.net
  [2020-04-15 16:36 UTC] cmb@php.net
  [2020-06-24 09:20 UTC] cmb@php.net
  [2020-06-24 09:20 UTC] cmb@php.net
 
-Status: Assigned
+Status: Closed
  [2020-06-24 09:21 UTC] cmb@php.net
 
-Assigned To: laruence
+Assigned To: cmb
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 18:00:01 2025 UTC | 
Description: ------------ Trying to use ReflectionClass::getStaticPropertyValue() on protected static properties of class results in exception with information about non existing property. However ReflectionClass::getStaticProperties() returns that property with correct value on all supported PHP versions. Adding ReflectionProperty::setAccessible(true) doesn't affect final effect. Of course I can use getStaticProperties() array, but maybe getStaticPropertyValue() should be fixed or at least some documentation note be added? After research I found it's related to #54620, but maybe setAccessible() should also affect getStaticPropertyValue() call? Test script: --------------- <?php class foo { protected static $test = 'bar'; } $classReflection = new ReflectionClass('foo'); $property = $classReflection->getProperty('test'); var_dump($property); $property->setAccessible(true); //Changes nothing in that case var_dump($classReflection->getStaticProperties()); var_dump($classReflection->getStaticPropertyValue('test')); Actual result: -------------- http://3v4l.org/om1lZ