<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.gmp.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'gmp.construct.php',
    1 => 'GMP::__construct',
    2 => 'Create GMP number',
  ),
  'up' => 
  array (
    0 => 'class.gmp.php',
    1 => 'GMP',
  ),
  'prev' => 
  array (
    0 => 'class.gmp.php',
    1 => 'GMP',
  ),
  'next' => 
  array (
    0 => 'gmp.serialize.php',
    1 => 'GMP::__serialize',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gmp/gmp/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="gmp.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">GMP::__construct</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.2.4)</p><p class="refpurpose"><span class="refname">GMP::__construct</span> &mdash; <span class="dc-title">Create GMP number</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-gmp.construct-description">
  <h3 class="title">Опис</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>GMP::__construct</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$num</code><span class="initializer"> = 0</span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$base</code><span class="initializer"> = 0</span></span>)</div>

  <p class="para rdfs-comment">
   Creates a GMP number from an integer or string.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-gmp.construct-parameters">
  <h3 class="title">Параметри</h3><dl>
   
    <dt><code class="parameter">num</code></dt>
    <dd>
     <span class="simpara">
      An integer or a string. The string representation can be decimal,
      hexadecimal, octal, or binary.
     </span>
    </dd>
   
   
    <dt><code class="parameter">base</code></dt>
    <dd>
     <span class="simpara">
      The base to use for converting a <span class="type"><a href="language.types.string.php" class="type string">string</a></span> representation.
     </span>
     <span class="simpara">
      An explicit base can be between <code class="literal">2</code> and <code class="literal">62</code>.
      For bases up to <code class="literal">36</code>, case is ignored;
      upper-case and lower-case letters have the same value.
      For bases <code class="literal">37</code> to <code class="literal">62</code>,
      upper-case letter represent the values <code class="literal">10</code> to
      <code class="literal">35</code> and lower-case letter represent the values
      <code class="literal">36</code> to <code class="literal">61</code>.
     </span>
     <span class="simpara">
      If <code class="parameter">base</code> is <code class="literal">0</code> then the actual
      base is determined from the leading characters of <code class="parameter">num</code>.
      If the first two characters are <code class="literal">0x</code> or <code class="literal">0X</code>,
      the string is interpreted as a hexadecimal integer.
      If the first two characters are <code class="literal">0b</code> or <code class="literal">0B</code>,
      the string is interpreted as a binary integer.
      If the first two characters are <code class="literal">0o</code> or <code class="literal">0o</code>,
      the string is interpreted as an octal integer.
      Moreover, if the first character is <code class="literal">0</code> the string
      is also interpreted as an octal integer.
      In all other cases, the string is interpreted as a decimal integer.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 seealso" id="refsect1-gmp.construct-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.gmp-init.php" class="function" rel="rdfs-seeAlso">gmp_init()</a> - Create GMP number</span></li>
  </ul>
 </div>


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