<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/language.types.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'language.types.singleton.php',
    1 => 'シングルトン型',
    2 => 'シングルトン型',
  ),
  'up' => 
  array (
    0 => 'language.types.php',
    1 => '型',
  ),
  'prev' => 
  array (
    0 => 'language.types.relative-class-types.php',
    1 => 'クラス内での関係を示す相対型',
  ),
  'next' => 
  array (
    0 => 'language.types.iterable.php',
    1 => 'Iterable',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'language/types/singleton.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="language.types.singleton" class="sect1">
 <h2 class="title">シングルトン型</h2>

 <p class="para">
  シングルトン型は、ただひとつの値のみを受け入れる型です。
  PHP はふたつのシングルトン型をサポートしています。
  PHP 8.0.0 以降でサポートされた <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> 型と、
  PHP 8.2.0 以降でサポートされた <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> 型です。
 </p>

 <div class="warning"><strong class="warning">警告</strong>
  <p class="simpara">
   PHP 8.2.0 より前のバージョンでは、
   <span class="type"><a href="language.types.singleton.php" class="type false">false</a></span>型は
   <a href="language.types.type-system.php#language.types.type-system.composite.union" class="link">union 型</a>
   の一部としてのみ使える型でした。
  </p>
 </div>

 <blockquote class="note"><p><strong class="note">注意</strong>: 
  <span class="simpara">
   カスタムのシングルトン型を定義することはできません。
   そうしたい場合、<a href="language.types.enumerations.php" class="link">列挙型(Enum)</a> を使うことを検討してください。
  </span>
 </p></blockquote>

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