cvs: phpdoc-zh /reference/classobj/functions get-declared-interfaces.xml interface-exists.xml property-exists.xml
| From: | Dallas Thunder | Date: | Fri, 20 Jan 2006 04:47:51 +0000 |
| Subject: | cvs: phpdoc-zh /reference/classobj/functions get-declared-interfaces.xml interface-exists.xml property-exists.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2752@lists.php.net to get a copy of this message | ||
dallas Fri Jan 20 04:47:51 2006 UTC
Added files:
/phpdoc-zh/reference/classobj/functions get-declared-interfaces.xml
interface-exists.xml
property-exists.xml
Log:
Add 3 new files.
http://cvs.php.net/viewcvs.cgi/phpdoc-zh/reference/classobj/functions/get-declared-interfaces.xml?view=markup&rev=1.1
Index: phpdoc-zh/reference/classobj/functions/get-declared-interfaces.xml
+++ phpdoc-zh/reference/classobj/functions/get-declared-interfaces.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready -->
<refentry id="function.get-declared-interfaces">
<refnamediv>
<refname>get_declared_interfaces</refname>
<refpurpose>·µ»ØÒ»¸öÊý×é°üº¬ËùÓÐÒÑÉùÃ÷µÄ½Ó¿Ú</refpurpose>
</refnamediv>
<refsect1>
<title>˵Ã÷</title>
<methodsynopsis>
<type>array</type><methodname>get_declared_interfaces</methodname>
<void/>
</methodsynopsis>
<para>
±¾º¯Êý·µ»ØÒ»¸öÊý×飬ÆäÄÚÈÝÊǵ±Ç°½Å±¾ÖÐËùÓÐÒÑÉùÃ÷µÄ½Ó¿ÚµÄÃû×Ö¡£
</para>
<para>
<example>
<title><function>get_declared_interfaces</function> Àý×Ó</title>
<programlisting role="php">
<![CDATA[
<?php
print_r(get_declared_interfaces());
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[0] => Traversable
[1] => IteratorAggregate
[2] => Iterator
[3] => ArrayAccess
[4] => reflector
[5] => RecursiveIterator
[6] => SeekableIterator
)
]]>
</screen>
</example>
</para>
<simpara>
²Î¼û <function>get_declared_classes</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
-->
http://cvs.php.net/viewcvs.cgi/phpdoc-zh/reference/classobj/functions/interface-exists.xml?view=markup&rev=1.1
Index: phpdoc-zh/reference/classobj/functions/interface-exists.xml
+++ phpdoc-zh/reference/classobj/functions/interface-exists.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.1 Maintainer: dallas Status: ready -->
<refentry id="function.interface-exists">
<refnamediv>
<refname>interface_exists</refname>
<refpurpose>¼ì²é½Ó¿ÚÊÇ·ñÒѱ»¶¨Òå</refpurpose>
</refnamediv>
<refsect1>
<title>˵Ã÷</title>
<methodsynopsis>
<type>bool</type><methodname>interface_exists</methodname>
<methodparam><type>string</type><parameter>interface_name</parameter></methodparam>
<methodparam
choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam>
</methodsynopsis>
<para>
±¾º¯ÊýÔÚÓÉ <parameter>interface_name</parameter>
¸ø³öµÄ½Ó¿ÚÒѶ¨Òåʱ·µ»Ø &true;£¬·ñÔò·µ»Ø &false;¡£
</para>
<para>
<example>
<title><function>interface_exists</function> Àý×Ó</title>
<programlisting role="php">
<![CDATA[
<?php
// Check the interface exists before trying to use it
if (interface_exists('MyInterface')) {
class MyClass implements MyInterface
{
// Methods
}
}
?>
]]>
</programlisting>
</example>
</para>
<para>
<function>interface_exists</function> ĬÈϻ᳢ÊÔµ÷ÓÃ
&link.autoload;£¬Èç¹û²»Ï£Íû
<function>interface_exists</function> È¥µ÷ÓÃ
&link.autoload;£¬¿ÉÒÔ½« <parameter>autoload</parameter> ²ÎÊýÉèΪ
&false;¡£
</para>
<simpara>
²Î¼û <function>class_exists</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
-->
http://cvs.php.net/viewcvs.cgi/phpdoc-zh/reference/classobj/functions/property-exists.xml?view=markup&rev=1.1
Index: phpdoc-zh/reference/classobj/functions/property-exists.xml
+++ phpdoc-zh/reference/classobj/functions/property-exists.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready -->
<refentry id="function.property-exists">
<refnamediv>
<refname>property_exists</refname>
<refpurpose>¼ì²é¶ÔÏó»òÀàÊÇ·ñ¾ßÓиÃÊôÐÔ</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>property_exists</methodname>
<methodparam><type>mixed</type><parameter>class</parameter></methodparam>
<methodparam><type>string</type><parameter>property</parameter></methodparam>
</methodsynopsis>
<para>
±¾º¯Êý¼ì²é¸ø³öµÄ <parameter>property</parameter>
ÊÇ·ñ´æÔÚÓÚÖ¸¶¨µÄÀàÖУ¨²¢ÇÒÊÇ·ñ±»ÉùÃ÷Ϊ public£©¡£
</para>
<note>
<para>
As opposed with <function>isset</function>,
<function>property_exists</function> returns &true; even if the property
has the value &null;.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>class</parameter></term>
<listitem>
<para>
×Ö·û´®ÐÎʽµÄÀàÃû»òÒª¼ì²éµÄÀàµÄÒ»¸ö¶ÔÏó
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>property</parameter></term>
<listitem>
<para>
ÊôÐÔµÄÃû×Ö
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Èç¹û¸ÃÊôÐÔ´æÔÚÔò·µ»Ø &true;£¬Èç¹û²»´æÔÚÔò·µ»Ø
&false;£¬³ö´í·µ»Ø &null;¡£
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>property_exists</function> Àý×Ó</title>
<programlisting role="php">
<![CDATA[
<?php
class myClass {
public $mine;
private $xpto;
}
var_dump(property_exists('myClass', 'mine')); //true
var_dump(property_exists(new myClass, 'mine')); //true
var_dump(property_exists('myClass', 'xpto')); //false, isn't public
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>method_exists</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:"../../../../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
-->