|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10096 get_object_vars does not work as expected
Submitted: 2001-04-01 03:46 UTC Modified: 2001-09-09 06:07 UTC
From: rcherry at raysoft dot net Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.0.4pl1 OS: Windows ME
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: rcherry at raysoft dot net
New email:
PHP Version: OS:


 [2001-04-01 03:46 UTC] rcherry at raysoft dot net
If variables within a class are set by the constructor, then get_object_vars works OK.  If they are set after the class object is constructed, then it doesn't work OK.


class a
{ var $b;

$aa = new a();
$aa->b = "Hi";
print_r(get_object_vars($aa);  //Result will not be as expected.

This error is complicating an effort to persist a class.


Related Issue:  It does not appear possible to have a variable within a class which is of type class. What a shame.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-09 06:07 UTC]
Works fine with the latest CVS.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 04:01:30 2024 UTC