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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
15 + 46 = ?
Subscribe to this entry?

 
 [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: Thu Mar 28 17:01:29 2024 UTC