2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 06:41:36 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.method-exists" xmlns="http://docbook.org/ns/docbook">
|
2007-01-14 13:37:31 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>method_exists</refname>
|
|
|
|
<refpurpose>Checks if the class method exists</refpurpose>
|
|
|
|
</refnamediv>
|
2007-01-14 15:10:19 +00:00
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-01-14 13:37:31 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>method_exists</methodname>
|
2008-09-17 09:38:47 +00:00
|
|
|
<methodparam><type>mixed</type><parameter>object</parameter></methodparam>
|
2007-01-14 13:37:31 +00:00
|
|
|
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2007-01-14 15:10:19 +00:00
|
|
|
Checks if the class method exists in the given
|
|
|
|
<parameter>object</parameter>.
|
2007-01-14 13:37:31 +00:00
|
|
|
</para>
|
2007-01-14 15:10:19 +00:00
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>object</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2008-09-17 09:38:47 +00:00
|
|
|
An object instance or a class name
|
2007-01-14 15:10:19 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>method_name</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The method name
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Returns &true; if the method given by <parameter>method_name</parameter>
|
|
|
|
has been defined for the given <parameter>object</parameter>, &false;
|
|
|
|
otherwise.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2009-12-30 12:24:42 +00:00
|
|
|
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
¬e.uses-autoload;
|
|
|
|
</refsect1>
|
|
|
|
|
2007-01-14 15:10:19 +00:00
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-01-14 13:37:31 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>method_exists</function> example</title>
|
|
|
|
<programlisting role="php">
|
2004-05-06 15:25:58 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$directory = new Directory('.');
|
|
|
|
var_dump(method_exists($directory,'read'));
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-14 13:37:31 +00:00
|
|
|
</programlisting>
|
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
2004-05-06 15:25:58 +00:00
|
|
|
<![CDATA[
|
|
|
|
bool(true)
|
2007-10-16 10:01:35 +00:00
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
<example>
|
|
|
|
<title>Static <function>method_exists</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
var_dump(method_exists('Directory','read'));
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
bool(true)
|
2004-05-06 15:25:58 +00:00
|
|
|
]]>
|
2007-01-14 13:37:31 +00:00
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
2007-01-14 15:10:19 +00:00
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2007-01-14 13:37:31 +00:00
|
|
|
<para>
|
2007-01-14 15:10:19 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>function_exists</function></member>
|
|
|
|
<member><function>is_callable</function></member>
|
2011-02-04 11:04:08 +00:00
|
|
|
<member><function>class_exists</function></member>
|
2007-01-14 15:10:19 +00:00
|
|
|
</simplelist>
|
2007-01-14 13:37:31 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-04-15 00:12:54 +00:00
|
|
|
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
|
|
|
|
-->
|