<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reserved.interfaces.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'class.php-incomplete-class.php',
    1 => '__PHP_Incomplete_Class',
    2 => 'The __PHP_Incomplete_Class class',
  ),
  'up' => 
  array (
    0 => 'reserved.interfaces.php',
    1 => 'Interfacce e Classi predefinite',
  ),
  'prev' => 
  array (
    0 => 'sensitiveparametervalue.getvalue.php',
    1 => 'SensitiveParameterValue::getValue',
  ),
  'next' => 
  array (
    0 => 'reserved.attributes.php',
    1 => 'Predefined Attributes',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/php-incomplete-class.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.php-incomplete-class" class="reference">

 <h1 class="title">The __PHP_Incomplete_Class class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 4 &gt;=4.0.1, PHP 5, PHP 7, PHP 8)</p>

  <div class="section" id="php-incomplete-class.intro">
   <h2 class="title">Introduzione</h2>
   <p class="para">
    Created by <span class="function"><a href="function.unserialize.php" class="function">unserialize()</a></span>
    when trying to unserialize an undefined class
    or a class that is not listed in the <code class="literal">allowed_classes</code>
    of <span class="function"><a href="function.unserialize.php" class="function">unserialize()</a></span>&#039;s <code class="parameter">options</code> array.
   </p>

   <p class="para">
    Prior to PHP 7.2.0, using <span class="function"><a href="function.is-object.php" class="function">is_object()</a></span> on the
    <span class="classname"><strong class="classname">__PHP_Incomplete_Class</strong></span> class would return <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
    As of PHP 7.2.0, <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> will be returned.
   </p>
  </div>

  <div class="section" id="php-incomplete-class.synopsis">
   <h2 class="title">Sommario della classe</h2>

   <div class="classsynopsis"><div class="classsynopsisinfo">
    
     <span class="attribute"><a href="class.allowdynamicproperties.php">#[\AllowDynamicProperties]</a> </span><br>
     <span class="modifier">final</span>
     <span class="modifier">class</span> <strong class="classname"><strong class="classname">__PHP_Incomplete_Class</strong></strong>
     {</div>
   }</div>

   <p class="para">
    This class has no default properties or methods.
    When created by <span class="function"><a href="function.unserialize.php" class="function">unserialize()</a></span>,
    in addition to all unserialized properties and values
    the object will have a <code class="literal">__PHP_Incomplete_Class_Name</code> property
    which will contain the name of the unserialized class.
   </p>
  </div>

  <div class="section" id="php-incomplete-class.changelog">
   <h2 class="title">Log delle modifiche</h2>
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Versione</th>
       <th>Descrizione</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        This class is now <code class="literal">final</code>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </div>

  <div class="section" id="php-incomplete-class.examples">
   <h2 class="title">Esempi</h2>
   <div class="example" id="php-incomplete-class.basic-example">
    <p><strong>Example #1 Created by <span class="function"><a href="function.unserialize.php" class="function">unserialize()</a></span></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<br /></span><span style="color: #007700">{<br />    public </span><span style="color: #0000BB">string $property </span><span style="color: #007700">= </span><span style="color: #DD0000">"myValue"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$myObject </span><span style="color: #007700">= new </span><span style="color: #0000BB">MyClass</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$foo </span><span style="color: #007700">= </span><span style="color: #0000BB">serialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$myObject</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// unserializes all objects into __PHP_Incomplete_Class objects<br /></span><span style="color: #0000BB">$disallowed </span><span style="color: #007700">= </span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">, [</span><span style="color: #DD0000">"allowed_classes" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">false</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$disallowed</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// unserializes all objects into __PHP_Incomplete_Class objects except those of MyClass2 and MyClass3<br /></span><span style="color: #0000BB">$disallowed2 </span><span style="color: #007700">= </span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">, [</span><span style="color: #DD0000">"allowed_classes" </span><span style="color: #007700">=&gt; [</span><span style="color: #DD0000">"MyClass2"</span><span style="color: #007700">, </span><span style="color: #DD0000">"MyClass3"</span><span style="color: #007700">]]);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$disallowed2</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// unserializes undefined class into __PHP_Incomplete_Class object<br /></span><span style="color: #0000BB">$undefinedClass </span><span style="color: #007700">= </span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #DD0000">'O:16:"MyUndefinedClass":0:{}'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$undefinedClass</span><span style="color: #007700">);</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>

object(__PHP_Incomplete_Class)#2 (2) {
  [&quot;__PHP_Incomplete_Class_Name&quot;]=&gt;
  string(7) &quot;MyClass&quot;
  [&quot;property&quot;]=&gt;
  string(7) &quot;myValue&quot;
}
object(__PHP_Incomplete_Class)#3 (2) {
  [&quot;__PHP_Incomplete_Class_Name&quot;]=&gt;
  string(7) &quot;MyClass&quot;
  [&quot;property&quot;]=&gt;
  string(7) &quot;myValue&quot;
}
object(__PHP_Incomplete_Class)#4 (1) {
  [&quot;__PHP_Incomplete_Class_Name&quot;]=&gt;
  string(16) &quot;MyUndefinedClass&quot;
}

</pre></div>
    </div>
   </div>
  </div>

 </div>

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