php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46795 Documentation for get_class_vars return value is inconsistent ("public")
Submitted: 2008-12-08 11:43 UTC Modified: 2009-05-25 18:03 UTC
From: phpbug dot classvars at sub dot noloop dot net Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2008-12-08 11:43 UTC] phpbug dot classvars at sub dot noloop dot net
Description:
------------
The documentation at http://no2.php.net/manual/en/function.get-class-vars.php claims that:
"Return Values

Returns an associative array of default public properties of the class. The resulting array elements are in the form of varname => value."

Apparently, since 5.2.7, the actual return value contains all default visible properties of the class depending on the scope of the caller.

(Originally reported as a bug in http://bugs.php.net/bug.php?id=46761)

Therefore I'm opening this bug report against documentation. The docs for this method should clarify that the return value may contain properties that are declared as "protected" or even "private" depending on calling scope.

Also ,it would be nice if the changelog could be updated with an entry for PHP 5.2.7, since the behaviour changed since 5.2.6.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-09 10:15 UTC] phpbug dot classvars at sub dot noloop dot net
Also see http://bugs.php.net/bug.php?id=46812
 [2009-05-25 18:03 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:10 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=f718752857117f39b27e1a974596f81a5f2d0261
Log: Fixed bug #46795 (Documentation for get_class_vars return value is inconsistent ("public"))
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 07:00:01 2026 UTC