<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionclass.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'reflectionclass.marklazyobjectasinitialized.php',
    1 => 'ReflectionClass::markLazyObjectAsInitialized',
    2 => 'Marks a lazy object as initialized without calling the initializer or factory',
  ),
  'up' => 
  array (
    0 => 'class.reflectionclass.php',
    1 => 'ReflectionClass',
  ),
  'prev' => 
  array (
    0 => 'reflectionclass.isuserdefined.php',
    1 => 'ReflectionClass::isUserDefined',
  ),
  'next' => 
  array (
    0 => 'reflectionclass.newinstance.php',
    1 => 'ReflectionClass::newInstance',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/reflection/reflectionclass/marklazyobjectasinitialized.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionclass.marklazyobjectasinitialized" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionClass::markLazyObjectAsInitialized</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">ReflectionClass::markLazyObjectAsInitialized</span> &mdash; <span class="dc-title">Marks a lazy object as initialized without calling the initializer or factory</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionclass.marklazyobjectasinitialized-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionClass::markLazyObjectAsInitialized</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.object.php" class="type object">object</a></span> <code class="parameter">$object</code></span>): <span class="type"><a href="language.types.object.php" class="type object">object</a></span></div>

  <p class="simpara">
   Marks a lazy object as initialized without calling the initializer or
   factory. This has no effect if <code class="parameter">object</code> is not lazy or
   is already initialized.
  </p>
  <p class="simpara">
   The effect of calling this method is the same as described for Ghost Objects
   (regardless of the laziness strategy of <code class="parameter">object</code>) in
   <a href="language.oop5.lazy-objects.php#language.oop5.lazy-objects.initialization-sequence" class="link">initialization
   sequence</a>, except that the initializer is not called.
   After that, the object is indistinguishable from an object that was never
   lazy and was created with
   <span class="methodname"><a href="reflectionclass.newinstancewithoutconstructor.php" class="methodname">ReflectionClass::newInstanceWithoutConstructor()</a></span>,
   except for the value of properties that were already initialized with
   <span class="methodname"><a href="reflectionproperty.setrawvaluewithoutlazyinitialization.php" class="methodname">ReflectionProperty::setRawValueWithoutLazyInitialization()</a></span>
   or <span class="methodname"><a href="reflectionproperty.skiplazyinitialization.php" class="methodname">ReflectionProperty::skipLazyInitialization()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionclass.marklazyobjectasinitialized-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
    <dt><code class="parameter">object</code></dt>
    <dd>
     <span class="simpara">
      The object to mark as initialized.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionclass.marklazyobjectasinitialized-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="simpara">
   Returns <code class="parameter">object</code>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-reflectionclass.marklazyobjectasinitialized-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-1">
   <p><strong>Örnek 1 Marking an uninitialized lazy object as initialized</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">Example<br /></span><span style="color: #007700">{<br />    public </span><span style="color: #0000BB">string $prop1</span><span style="color: #007700">;<br />    public </span><span style="color: #0000BB">string $prop2</span><span style="color: #007700">;<br />    public </span><span style="color: #0000BB">string $prop3 </span><span style="color: #007700">= </span><span style="color: #DD0000">'default value'</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$reflector </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionClass</span><span style="color: #007700">(</span><span style="color: #0000BB">Example</span><span style="color: #007700">::class);<br /><br /></span><span style="color: #0000BB">$object </span><span style="color: #007700">= </span><span style="color: #0000BB">$reflector</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newLazyGhost</span><span style="color: #007700">(function (</span><span style="color: #0000BB">$object</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"Initializer called\n"</span><span style="color: #007700">;<br />    </span><span style="color: #0000BB">$object</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prop1 </span><span style="color: #007700">= </span><span style="color: #DD0000">'initialized'</span><span style="color: #007700">;<br />});<br /><br /></span><span style="color: #0000BB">$reflector</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getProperty</span><span style="color: #007700">(</span><span style="color: #DD0000">'prop1'</span><span style="color: #007700">)<br />          -&gt;</span><span style="color: #0000BB">setRawValueWithoutLazyInitialization</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">, </span><span style="color: #DD0000">'prop1 value'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$reflector</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">markLazyObjectAsInitialized</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>
Yukarıdaki örneğin çıktısı:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">lazy ghost object(Example)#3 (1) {
  [&quot;prop1&quot;]=&gt;
  string(11) &quot;prop1 value&quot;
  [&quot;prop2&quot;]=&gt;
  uninitialized(string)
  [&quot;prop3&quot;]=&gt;
  uninitialized(string)
}
object(Example)#3 (2) {
  [&quot;prop1&quot;]=&gt;
  string(11) &quot;prop1 value&quot;
  [&quot;prop2&quot;]=&gt;
  uninitialized(string)
  [&quot;prop3&quot;]=&gt;
  string(13) &quot;default value&quot;
}</pre>
</div>
   </div>
  </div>
  <div class="example" id="example-2">
   <p><strong>Örnek 2 Marking an initialized object as initialized</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">Example<br /></span><span style="color: #007700">{<br />    public </span><span style="color: #0000BB">string $prop1</span><span style="color: #007700">;<br />    public </span><span style="color: #0000BB">string $prop2</span><span style="color: #007700">;<br />    public </span><span style="color: #0000BB">string $prop3 </span><span style="color: #007700">= </span><span style="color: #DD0000">'default value'</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$reflector </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionClass</span><span style="color: #007700">(</span><span style="color: #0000BB">Example</span><span style="color: #007700">::class);<br /><br /></span><span style="color: #0000BB">$object </span><span style="color: #007700">= </span><span style="color: #0000BB">$reflector</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newLazyGhost</span><span style="color: #007700">(function (</span><span style="color: #0000BB">$object</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"Initializer called\n"</span><span style="color: #007700">;<br />    </span><span style="color: #0000BB">$object</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prop1 </span><span style="color: #007700">= </span><span style="color: #DD0000">'initialized'</span><span style="color: #007700">;<br />});<br /><br /></span><span style="color: #0000BB">$reflector</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getProperty</span><span style="color: #007700">(</span><span style="color: #DD0000">'prop1'</span><span style="color: #007700">)<br />          -&gt;</span><span style="color: #0000BB">setRawValueWithoutLazyInitialization</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">, </span><span style="color: #DD0000">'prop1 value'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prop3</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$reflector</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">markLazyObjectAsInitialized</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>
Yukarıdaki örneğin çıktısı:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Initializer called
string(13) &quot;default value&quot;
object(Example)#3 (2) {
  [&quot;prop1&quot;]=&gt;
  string(11) &quot;initialized&quot;
  [&quot;prop2&quot;]=&gt;
  uninitialized(string)
  [&quot;prop3&quot;]=&gt;
  string(13) &quot;default value&quot;
}
object(Example)#3 (2) {
  [&quot;prop1&quot;]=&gt;
  string(11) &quot;initialized&quot;
  [&quot;prop2&quot;]=&gt;
  uninitialized(string)
  [&quot;prop3&quot;]=&gt;
  string(13) &quot;default value&quot;
}</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionclass.marklazyobjectasinitialized-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <ul class="simplelist">
   <li><a href="language.oop5.lazy-objects.php" class="link">Lazy objects</a></li>
   <li><span class="methodname"><a href="reflectionclass.newlazyghost.php" class="methodname" rel="rdfs-seeAlso">ReflectionClass::newLazyGhost()</a> - Creates a new lazy ghost instance</span></li>
   <li><span class="methodname"><a href="reflectionclass.initializelazyobject.php" class="methodname" rel="rdfs-seeAlso">ReflectionClass::initializeLazyObject()</a> - Forces initialization of a lazy object</span></li>
   <li><span class="methodname"><a href="reflectionclass.isuninitializedlazyobject.php" class="methodname" rel="rdfs-seeAlso">ReflectionClass::isUninitializedLazyObject()</a> - Checks if an object is lazy and uninitialized</span></li>
  </ul>
 </div>


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