php.net |  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
 [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.

Example:

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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-09 06:07 UTC] sterling@php.net
Works fine with the latest CVS.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Nov 16 23:01:41 2019 UTC