Files
php-doc-ru/reference/classobj/functions/get-object-vars.xml
Shein Alexey 9e821841a4 Bumped new revision number.
git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@327493 c90b9560-bf6c-de11-be94-00142212c4b1
2012-09-06 09:41:40 +00:00

163 lines
4.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 42a4393f0f8537267a90ec425168d678353a8a46 Maintainer: shein Status: ready -->
<!-- Reviewed: no -->
<!-- $Revision$ -->
<refentry xml:id="function.get-object-vars" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>get_object_vars</refname>
<refpurpose>Возвращает свойства указанного объекта</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>get_object_vars</methodname>
<methodparam><type>object</type><parameter>object</parameter></methodparam>
</methodsynopsis>
<para>
Возвращает видимые нестатические свойства указанного объекта
<parameter>object</parameter> в соответствии с областью видимости.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>object</parameter></term>
<listitem>
<para>
Экземпляр объекта
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает ассоциативный массив нестатических свойств объекта
<parameter>object</parameter>, доступных в данной области видимости.
Если свойству не было присвоено значение, оно будет возвращено со
значением &null;.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.3.0</entry>
<entry>
Функция теперь возвращает <type>NULL</type>, если
<parameter>object</parameter> не является объектом.
Ранее возвращался &false;.
</entry>
</row>
<row>
<entry>4.2.0</entry>
<entry>
Свойства, которые были объявлены в классе объекта
<parameter>object</parameter>, но которым не были
присвоены значения, теперь также возвращаются
(со значением &null;).
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>get_object_vars</function></title>
<programlisting role="php">
<![CDATA[
<?php
class foo {
private $a;
public $b = 1;
public $c;
private $d;
static $e;
public function test() {
var_dump(get_object_vars($this));
}
}
$test = new foo;
var_dump(get_object_vars($test));
$test->test();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(2) {
["b"]=>
int(1)
["c"]=>
NULL
}
array(4) {
["a"]=>
NULL
["b"]=>
int(1)
["c"]=>
NULL
["d"]=>
NULL
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>get_class_methods</function></member>
<member><function>get_class_vars</function></member>
</simplelist>
</para>
</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:"~/.phpdoc/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
-->