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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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.

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

Pull Requests

History

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