nlopess         Mon Apr 18 11:21:37 2005 EDT

  Added files:                 
    /phpdoc/en/reference/classobj/functions     property-exists.xml 
  Log:
  add docs for property_exists()
  #the name for this function might change, but I'm adding it so that I won't 
lost this file. I'll rename the file later if necessary
  

http://cvs.php.net/co.php/phpdoc/en/reference/classobj/functions/property-exists.xml?r=1.1&p=1
Index: phpdoc/en/reference/classobj/functions/property-exists.xml
+++ phpdoc/en/reference/classobj/functions/property-exists.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.property-exists">
 <refnamediv>
  <refname>property_exists</refname>
  <refpurpose>
   Checks if the object or class has a property
  </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>
   This function checks if the given <parameter>property</parameter> exists in
   the specified class (and if it was declared as public).
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>class</parameter></term>
      <listitem>
       <para>
        A string with the class name or an object of the class to test for
       </para>
      </listitem>
     </varlistentry>
    <varlistentry>
     <term><parameter>property</parameter></term>
      <listitem>
       <para>
        The name of the property
       </para>
      </listitem>
     </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns &true; if the property exists or &false; otherwise.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>A <function>property_exists</function> example</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
-->

Reply via email to