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

You Are At PHP: get_class_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_class_vars

(PHP 4, PHP 5)

get_class_vars -- Get the default properties of the class

Description

array get_class_vars ( string class_name )

Get the default properties of the given class.

Parameters

class_name

The class name

Return Values

Returns an associative array of default public properties of the class. The resulting array elements are in the form of varname => value.

ChangeLog

VersionDescription
Prior to 4.2.0 Uninitialized class variables will not be reported by get_class_vars()

Examples

Example 1. get_class_vars() example

<?php

class myclass {

    var
$var1; // this has no default value...
    
var $var2 = "xyz";
    var
$var3 = 100;
    
private $var4; // PHP 5

    // constructor
    
function myclass() {
        
// change some properties
        
$this->var1 = "foo";
        
$this->var2 = "bar";
        return
true;
    }

}

$my_class = new myclass();

$class_vars = get_class_vars(get_class($my_class));

foreach (
$class_vars as $name => $value) {
    echo
"$name : $value\n";
}

?>

The above example will output:

// Before PHP 4.2.0
var2 : xyz
var3 : 100

// As of PHP 4.2.0
var1 :
var2 : xyz
var3 : 100

See Also

get_class_methods()
get_object_vars()

Najlepsza ochrona mienia na rynku
tłumaczenia
opakowania z nadrukiem
Najlepsza organizacja eventów Gorąco Polecamy!
Strony internetowe

Another Useful functions:


zend-api.zend-u-get-constant | zend-api.zend-hash-get-current-key | zend-api.zend-hash-get-current-key-type | zend-api.zend-hash-get-current-key-type-ex | zend-api.zend-hash-get-current-key-ex | zend-api.zend-hash-get-current-data | zend-api.zend-hash-get-current-data-ex | zend-api.zend-get-constant | zend-api.zend-get-configuration-directive | zend-api.zend-get-compiled-variable-value | zend-api.zend-get-compiled-variable-name | zend-api.zend-get-compiled-script-encoding | zend-api.zend-get-compiled-lineno | zend-api.zend-get-compiled-filename | zend-api.zend-get-class-entry | function.zlib-get-coding-type | function.xml-get-current-line-number | function.xml-get-current-column-number | function.xml-get-current-byte-index | function.tidy-get-config | function.stream-get-contents | function.session-get-cookie-params | function.ob-get-contents | function.ob-get-clean | function.newt-radio-get-current | function.newt-listbox-get-current | function.newt-form-get-current | function.newt-checkbox-tree-get-current | function.mysqli-get-client-version | function.mysqli-get-client-info | function.mysqli-get-charset | function.mysql-get-client-info | function.mcrypt-get-cipher-name | function.maxdb-get-client-version | function.maxdb-get-client-info | function.ifx-get-char | function.get-current-user | function.get-class | function.get-class-vars | function.get-class-methods | function.get-cfg-var | function.file-get-contents | function.domnode-get-content |


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.