<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectiontype.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'reflectiontype.allowsnull.php',
    1 => 'ReflectionType::allowsNull',
    2 => 'null が許されるかをチェックする',
  ),
  'up' => 
  array (
    0 => 'class.reflectiontype.php',
    1 => 'ReflectionType',
  ),
  'prev' => 
  array (
    0 => 'class.reflectiontype.php',
    1 => 'ReflectionType',
  ),
  'next' => 
  array (
    0 => 'reflectiontype.tostring.php',
    1 => 'ReflectionType::__toString',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/reflection/reflectiontype/allowsnull.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectiontype.allowsnull" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionType::allowsNull</h1>
  <p class="verinfo">(PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionType::allowsNull</span> &mdash; <span class="dc-title">null が許されるかをチェックする</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectiontype.allowsnull-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionType::allowsNull</strong></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   引数が <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> を許容するかをチェックします。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-reflectiontype.allowsnull-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">この関数にはパラメータはありません。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectiontype.allowsnull-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> が許容されるなら <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を、そうでないなら <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>


  <div class="refsect1 examples" id="refsect1-reflectiontype.allowsnull-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="methodname"><strong>ReflectionType::allowsNull()</strong></span> の例</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">someFunction</span><span style="color: #007700">(</span><span style="color: #0000BB">string $param</span><span style="color: #007700">, </span><span style="color: #0000BB">stdClass $param2 </span><span style="color: #007700">= </span><span style="color: #0000BB">null</span><span style="color: #007700">) {}<br /><br /></span><span style="color: #0000BB">$reflectionFunc </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionFunction</span><span style="color: #007700">(</span><span style="color: #DD0000">'someFunction'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$reflectionParams </span><span style="color: #007700">= </span><span style="color: #0000BB">$reflectionFunc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getParameters</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$reflectionParams</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]-&gt;</span><span style="color: #0000BB">getType</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">allowsNull</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$reflectionParams</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]-&gt;</span><span style="color: #0000BB">getType</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">allowsNull</span><span style="color: #007700">());</span></span></code></div>
    </div>

    <div class="example-contents"><p>上の例の出力は以下となります。</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">bool(false)
bool(true)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectiontype.allowsnull-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="reflectionnamedtype.isbuiltin.php" class="methodname" rel="rdfs-seeAlso">ReflectionNamedType::isBuiltin()</a> - 組み込みの型であるかを調べる</span></li>
    <li><span class="methodname"><a href="reflectiontype.tostring.php" class="methodname" rel="rdfs-seeAlso">ReflectionType::__toString()</a> - 文字列に変換する</span></li>
    <li><span class="methodname"><a href="reflectionparameter.gettype.php" class="methodname" rel="rdfs-seeAlso">ReflectionParameter::getType()</a> - 引数の型を取得する</span></li>
   </ul>
  </p>
 </div>


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