mirror of
https://github.com/php/doc-ru.git
synced 2025-08-15 23:42:35 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@305403 c90b9560-bf6c-de11-be94-00142212c4b1
75 lines
2.2 KiB
XML
75 lines
2.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
<!-- EN-Revision: n/a Maintainer: lovchy Status: ready -->
|
||
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.33 -->
|
||
<refentry xml:id="function.is-a" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>is_a</refname>
|
||
<refpurpose>
|
||
Возвращает &true; если объект принадлежит классу или является одним из
|
||
его наследователей.
|
||
</refpurpose>
|
||
</refnamediv>
|
||
<refsect1>
|
||
<title>Описание</title>
|
||
<methodsynopsis>
|
||
<type>bool</type><methodname>is_a</methodname>
|
||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
Функция возвращает &true; если объект принадлежит классу или является
|
||
одним из его наследователей. В противном случае возвращается &false;
|
||
</para>
|
||
<para>
|
||
<example>
|
||
<title>Пример использования <function>is_a</function></title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
// объявление класса
|
||
class WidgetFactory
|
||
{
|
||
var $oink = 'moo';
|
||
}
|
||
|
||
// создание нового объекта
|
||
$WF = new WidgetFactory();
|
||
|
||
if (is_a($WF, 'WidgetFactory')) {
|
||
echo "yes, \$WF is still a WidgetFactory\n";
|
||
}
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
</example>
|
||
</para>
|
||
<simpara>
|
||
См. также <function>get_class</function>,
|
||
<function>get_parent_class</function> и
|
||
<function>is_subclass_of</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:"../~/.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
|
||
-->
|