<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.1 -->
  <refentry id="function.get-class-vars">
   <refnamediv>
    <refname>get_class_vars</refname>
    <refpurpose>
     Returns an array of default properties of the class
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>get_class_vars</methodname>
      <methodparam><type>string</type><parameter>class_name</parameter></methodparam>
     </methodsynopsis>
    <para>
     This function will return an associative array of default
     properties of the class.  The resulting array elements are in the
     form of <parameter>varname => value</parameter>.
    </para>
    <note>
     <para>
      Prior to PHP 4.2.0, Uninitialized class variables will not be reported
      by <function>get_class_vars</function>. 
     </para>
    </note>
    <para>
     <example>
      <title><function>get_class_vars</function> example</title>
      <programlisting role="php">
<![CDATA[
<?php

class myclass {

    var $var1; // this has no default value...
    var $var2 = "xyz";
    var $var3 = 100;
    
    // constructor
    function myclass() {
        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";
}

?>      
]]>
      </programlisting>
     </example>
    </para>
    <para>
     Will produce:
     <informalexample>
      <programlisting>
<![CDATA[
// Before PHP 4.2.0
var2 : xyz
var3 : 100

// As of PHP 4.2.0
var1 :
var2 : xyz
var3 : 100
]]>
      </programlisting>
     </informalexample>
    </para>
    <simpara>
     See also <function>get_class_methods</function>,
     <function>get_object_vars</function>
    </simpara>
   </refsect1>
  </refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->