<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.classobj.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.property-exists.php',
    1 => 'property_exists',
    2 => 'Pr&uuml;ft, ein Objekt oder eine Klasse auf die angegebene Eigenschaft',
  ),
  'up' => 
  array (
    0 => 'ref.classobj.php',
    1 => 'Klassen- und Objekt-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.method-exists.php',
    1 => 'method_exists',
  ),
  'next' => 
  array (
    0 => 'function.trait-exists.php',
    1 => 'trait_exists',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/classobj/functions/property-exists.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.property-exists" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">property_exists</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">property_exists</span> &mdash; <span class="dc-title">Prüft, ein Objekt oder eine Klasse auf die angegebene Eigenschaft</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.property-exists-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>property_exists</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.object.php" class="type object">object</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$object_or_class</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$property</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Prüft ob die Eigenschaft <code class="parameter">property</code> in der angegebenen
   Klasse existiert.
  </p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Anders als <span class="function"><a href="function.isset.php" class="function">isset()</a></span> gibt
    <span class="function"><strong>property_exists()</strong></span> auch dann <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück, wenn eine
    Eigenschaft den Wert <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> hat.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.property-exists-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">object_or_class</code></dt>
      <dd>
       <p class="para">
        Der Name der Klasse oder ein Objekt der Klasse, die geprüft werden soll
       </p>
      </dd>
     
    
     <dt><code class="parameter">property</code></dt>
      <dd>
       <p class="para">
        Der Name der Eigenschaft
       </p>
      </dd>
     
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.property-exists-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück, wenn die Eigenschaft existiert, und <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, wenn nicht.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.property-exists-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Ein <span class="function"><strong>property_exists()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">class </span><span style="color: #0000BB">myClass </span><span style="color: #007700">{<br />    public </span><span style="color: #0000BB">$mine</span><span style="color: #007700">;<br />    private </span><span style="color: #0000BB">$xpto</span><span style="color: #007700">;<br />    static protected </span><span style="color: #0000BB">$test</span><span style="color: #007700">;<br /><br />    static function </span><span style="color: #0000BB">test</span><span style="color: #007700">() {<br />        </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">property_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'myClass'</span><span style="color: #007700">, </span><span style="color: #DD0000">'xpto'</span><span style="color: #007700">)); </span><span style="color: #FF8000">//true<br />    </span><span style="color: #007700">}<br />}<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">property_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'myClass'</span><span style="color: #007700">, </span><span style="color: #DD0000">'mine'</span><span style="color: #007700">));   </span><span style="color: #FF8000">//true<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">property_exists</span><span style="color: #007700">(new </span><span style="color: #0000BB">myClass</span><span style="color: #007700">, </span><span style="color: #DD0000">'mine'</span><span style="color: #007700">)); </span><span style="color: #FF8000">//true<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">property_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'myClass'</span><span style="color: #007700">, </span><span style="color: #DD0000">'xpto'</span><span style="color: #007700">));   </span><span style="color: #FF8000">//true<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">property_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'myClass'</span><span style="color: #007700">, </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">));    </span><span style="color: #FF8000">//false<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">property_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'myClass'</span><span style="color: #007700">, </span><span style="color: #DD0000">'test'</span><span style="color: #007700">));   </span><span style="color: #FF8000">//true<br /></span><span style="color: #0000BB">myClass</span><span style="color: #007700">::</span><span style="color: #0000BB">test</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.property-exists-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
<p class="para">Ein Aufruf dieser Funktion verwendet alle registrierten
<a href="language.oop5.autoload.php" class="link">Autoloader</a>, falls die Klasse
nicht bereits bekannt ist.</p></p></blockquote>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Die Funktion <span class="function"><strong>property_exists()</strong></span> kann keine Eigenschaften
    erkennen, die über die &#039;magische&#039; Methode
    <a href="language.oop5.overloading.php#language.oop5.overloading.members" class="link"><code class="literal">__get</code></a>
    implementiert sind.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.property-exists-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.method-exists.php" class="function" rel="rdfs-seeAlso">method_exists()</a> - Pr&uuml;ft ob eine Methode innerhalb eines Objekts existiert</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>