PHP: get_object_vars - Manual in Deutsh
PHP: get_object_vars - Manual in French
PHP: get_object_vars - Manual in Polish

You Are At PHP: get_object_vars - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

get_object_vars

(PHP 4, PHP 5)

get_object_vars -- Gets the properties of the given object

Description

array get_object_vars ( object object )

Gets the properties of the given object.

Parameters

object

An object instance.

Return Values

Returns an associative array of defined object properties for the specified object. If a property have not been assigned a value, it will be returned with a NULL value.

ChangeLog

VersionDescription
prior to 4.2.0 If the variables declared in the class of which the object is an instance, have not been assigned a value, those will not be returned in the array

Examples

Example 1. Use of get_object_vars()

<?php
class Point2D {
    var
$x, $y;
    var
$label;

    function
Point2D($x, $y)
    {
        
$this->x = $x;
        
$this->y = $y;
    }

    function
setLabel($label)
    {
        
$this->label = $label;
    }

    function
getPoint()
    {
        return array(
"x" => $this->x,
                     
"y" => $this->y,
                     
"label" => $this->label);
    }
}

// "$label" is declared but not defined
$p1 = new Point2D(1.233, 3.445);
print_r(get_object_vars($p1));

$p1->setLabel("point #1");
print_r(get_object_vars($p1));

?>

The above example will output:

Array
 (
     [x] => 1.233
     [y] => 3.445
     [label] =>
 )

 Array
 (
     [x] => 1.233
     [y] => 3.445
     [label] => point #1
 )

See Also

get_class_methods()
get_class_vars()

Wyjatkowej jakości meble medyczne w xmebel
Kotły gazowe
Grzejniki
zespół weselny warszawa
Największa baza pytań egzamin doradca podatkowy testy na doradce podatkowego

Another Useful functions:


zend-api.zend-object-store-get-object | zend-api.zend-get-object-classname | function.yaz-get-option | function.xml-parser-get-option | function.tidy-get-output | function.tidy-get-opt-doc | function.stream-context-get-options | function.socket-get-option | function.printer-get-option | function.ldap-get-option | function.get-object-vars | function.ftp-get-option | function.fdf-get-opt |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.