|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20295 get_class_vars doesn't show values
Submitted: 2002-11-07 02:51 UTC Modified: 2002-11-07 11:10 UTC
From: kkobashi at thegrid dot net Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.2.2 OS: Win NT 4.0
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.
Block user comment
Status: Assign to:
Bug Type:
From: kkobashi at thegrid dot net
New email:
PHP Version: OS:


 [2002-11-07 02:51 UTC] kkobashi at thegrid dot net
class A
    var $hello;
    var $world;

    function A()
        $this->hello = "hello";

$a = get_class_vars("A");
foreach ($a as $key => $val)
    echo $key . ": " . $val . "<br>";

Output does not show the value as it suggests in the documentation. The output I get is:


Notice that the value of $hello is not shown.
Docs say uninitialized variables are not shown. But clearly hello is initialized.

Calling this:
   $a = get_class_vars("A");

   Array ( [hello] => [world] => ) 

Which also is wrong because of no values in hello


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-07 03:37 UTC] kkobashi at thegrid dot net

This is not a bug... only initialized class variables are shown.

Close this one
 [2002-11-07 11:10 UTC]
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 13:01:29 2024 UTC