★ wanayoo — archive 1999 http://www.php.net/manual/function.get-object-vars.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Classes/Objects
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
Classes/Objects
* get_class
* get_parent_class
* get_class_methods
* get_class_vars
* get_object_vars
* is_subclass_of
* class_exists
* method_exists
* get_declared_classes
* call_user_method
Manual: get_object_vars
View the source code for this pageSearch the site



Previous page
 get_class_vars
 Updated
Sat, 12 Aug 2000
is_subclass_of 
Next page


get_object_vars

(PHP4 >= 4.0RC1)

get_object_vars -- Returns an associative array of object properties

Description

array get_object_vars (object obj)

This function returns an associative array of object properties for the specified object obj.

See also get_class_methods(), get_class_vars()


User Contributed Notes: get_object_vars


cleong@organic.com
01-Jul-2000 10:58
get_object_vars() takes an object and returns it's properties in an associative array. The variable won't appear unless it's set, even if it's in the class definition. The following example would print "b, c."

<pre>
class hello {
var $a;
var $b;
};

$obj = new hello;
$obj->b = 'world';
$obj->c = 'war';

$vars = get_object_vars($obj);
echo implode(', ', array_flip($vars));
</pre>



 About Notes


Previous page
 get_class_vars
 Updated
Sat, 12 Aug 2000
is_subclass_of 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.