<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionproperty.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'reflectionproperty.setvalue.php',
    1 => 'ReflectionProperty::setValue',
    2 => '&Ouml;zelliğe değer atar',
  ),
  'up' => 
  array (
    0 => 'class.reflectionproperty.php',
    1 => 'ReflectionProperty',
  ),
  'prev' => 
  array (
    0 => 'reflectionproperty.setrawvaluewithoutlazyinitialization.php',
    1 => 'ReflectionProperty::setRawValueWithoutLazyInitialization',
  ),
  'next' => 
  array (
    0 => 'reflectionproperty.skiplazyinitialization.php',
    1 => 'ReflectionProperty::skipLazyInitialization',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'tr',
    'path' => 'reference/reflection/reflectionproperty/setvalue.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionproperty.setvalue" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionProperty::setValue</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionProperty::setValue</span> &mdash; <span class="dc-title">Özelliğe değer atar</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionproperty.setvalue-description">
  <h3 class="title">Açıklama</h3>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionProperty::setValue</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.object.php" class="type object">object</a></span> <code class="parameter">$nesne</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$değer</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>ReflectionProperty::setValue</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$değer</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Bir özelliğe değer atar.
  </p>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <span class="simpara">
    PHP 8.3.0 ve sonrasında, bu yöntemin tek bağımsız değişkenle çağrılması
    önerilmemektedir. Yerine
    <span class="methodname"><a href="reflectionclass.setstaticpropertyvalue.php" class="methodname">ReflectionClass::setStaticPropertyValue()</a></span>
    kullanılmalıdır.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionproperty.setvalue-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">nesne</code></dt>
     <dd>
      <p class="para">
       Özellik statik değilse özelliğin ait olduğu nesne,
       statik ise <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> belirtilmelidir.
      </p>
     </dd>
    
    
     <dt><code class="parameter">değer</code></dt>
     <dd>
      <p class="para">
       Yeni değer.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionproperty.setvalue-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
   Hiçbir değer dönmez.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-reflectionproperty.setvalue-changelog">
  <h3 class="title">Sürüm Bilgisi</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Sürüm: </th>
      <th>Açıklama</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       Bu yöntemin tek bağımsız değişkenle çağrılması artık önerilmiyor.
       Duruk özellikleri değiştirmek için bunun yerine
       <span class="methodname"><a href="reflectionclass.setstaticpropertyvalue.php" class="methodname">ReflectionClass::setStaticPropertyValue()</a></span>
       kullanılmalıdır.
      </td>
     </tr>

     <tr>
      <td>8.1.0</td>
      <td>
       Private ve protected özellikler
       <span class="methodname"><strong>ReflectionProperty::setValue()</strong></span> tarafından hemen
       erişilebilir olur. Evvelce erişilebilir olmaları için
       <span class="methodname"><a href="reflectionproperty.setaccessible.php" class="methodname">ReflectionProperty::setAccessible()</a></span> çağrısı
       yapmak gerekirdi; özellik erişilebilir değilse
       <span class="classname"><a href="class.reflectionexception.php" class="classname">ReflectionException</a></span> istisnası oluşurdu.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-reflectionproperty.setvalue-examples">
  <h3 class="title">Örnekler</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Örnek 1 - <span class="methodname"><strong>ReflectionProperty::setValue()</strong></span> örneği</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">Foo </span><span style="color: #007700">{<br />    public static </span><span style="color: #0000BB">$staticProperty</span><span style="color: #007700">;<br /><br />    public </span><span style="color: #0000BB">$property</span><span style="color: #007700">;<br />    protected </span><span style="color: #0000BB">$privateProperty</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$reflectionClass </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionClass</span><span style="color: #007700">(</span><span style="color: #DD0000">'Foo'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// PHP 8.3 ve sonrasında, duruk özelliklere değer atamak için<br />// setValue değil setStaticPropertyValue() kullanılmalıdır.<br /></span><span style="color: #0000BB">$reflectionClass</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setStaticPropertyValue</span><span style="color: #007700">(</span><span style="color: #DD0000">'staticProperty'</span><span style="color: #007700">, </span><span style="color: #DD0000">'foo'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">Foo</span><span style="color: #007700">::</span><span style="color: #0000BB">$staticProperty</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$foo </span><span style="color: #007700">= new </span><span style="color: #0000BB">Foo</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$reflectionClass</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getProperty</span><span style="color: #007700">(</span><span style="color: #DD0000">'property'</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">setValue</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">, </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">property</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$reflectionProperty </span><span style="color: #007700">= </span><span style="color: #0000BB">$reflectionClass</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getProperty</span><span style="color: #007700">(</span><span style="color: #DD0000">'privateProperty'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$reflectionProperty</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setAccessible</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">); </span><span style="color: #FF8000">// yalnızca PHP 8.1.0 öncesi<br /></span><span style="color: #0000BB">$reflectionProperty</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setValue</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">, </span><span style="color: #DD0000">'foobar'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$reflectionProperty</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getValue</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</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">string(3) &quot;foo&quot;
string(3) &quot;bar&quot;
string(6) &quot;foobar&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionproperty.setvalue-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="reflectionproperty.getvalue.php" class="methodname" rel="rdfs-seeAlso">ReflectionProperty::getValue()</a> - &Ouml;zelliğin değerini d&ouml;nd&uuml;r&uuml;r</span></li>
   <li><span class="methodname"><a href="reflectionproperty.setaccessible.php" class="methodname" rel="rdfs-seeAlso">ReflectionProperty::setAccessible()</a> - &Ouml;zelliği erişilebilir kılar</span></li>
   <li><span class="methodname"><a href="reflectionclass.setstaticpropertyvalue.php" class="methodname" rel="rdfs-seeAlso">ReflectionClass::setStaticPropertyValue()</a> - Statik &ouml;zelliğe değer atar</span></li>
  </ul>
 </div>


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