php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30381 Strange results with get_class_vars()
Submitted: 2004-10-10 13:48 UTC Modified: 2004-10-13 00:22 UTC
From: guth at fiifo dot u-psud dot fr Assigned: helly (profile)
Status: Closed Package: Class/Object related
PHP Version: 5.0.2 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guth at fiifo dot u-psud dot fr
New email:
PHP Version: OS:

 

 [2004-10-10 13:48 UTC] guth at fiifo dot u-psud dot fr
Description:
------------
I think that get_class_vars() should have the same 
behaviour that get_class_method(). 
The problem is that get_class_method() prints static 
methods, but get_class_vars() doesn't prints static 
properties. 
The documentation doesn't say anything on static 
properties, so i think that get_class_vars() should print 
static properties. 

Reproduce code:
---------------
<?php
class plop {
	public static $plip;
	public static function plip() { }
}

var_dump(get_class_methods('plop'));
var_dump(get_class_vars('plop'));
?>

Expected result:
----------------
array(1) { [0] => string(4) "plip" } 
array(0) {} 

Actual result:
--------------
array(1) { [0] => string(4) "plip" } 
array(1) { [0] => string(4) "plip" } 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-10 15:01 UTC] guth at fiifo dot u-psud dot fr
oops, i swaped expected and actual results. 
sorry :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 05:01:27 2024 UTC