mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
* inclusão de arquivos originais com revisão atualizada * tradução em splfixedarray * typo * removed unstranslated line
124 lines
2.9 KiB
XML
124 lines
2.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
|
|
<refentry xml:id="splfixedarray.construct" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>SplFixedArray::__construct</refname>
|
|
<refpurpose>Constrói um novo array fixo</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<constructorsynopsis role="SplFixedArray">
|
|
<modifier>public</modifier> <methodname>SplFixedArray::__construct</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>size</parameter><initializer>0</initializer></methodparam>
|
|
</constructorsynopsis>
|
|
<para>
|
|
Inicializa um array fixo com um número de valores &null; igual ao <parameter>size</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>size</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O tamanho do array fixo.
|
|
Isso espera um número entre <literal>0</literal> e <constant>PHP_INT_MAX</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Lança um <classname>ValueError</classname> quando <parameter>size</parameter>
|
|
é um número inteiro negativo.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
Agora lança um <classname>ValueError</classname> se
|
|
<parameter>size</parameter> é negativo;
|
|
anteriormente lançava um <classname>InvalidArgumentException</classname>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>SplFixedArray::__construct</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$array = new SplFixedArray(5);
|
|
|
|
$array[1] = 2;
|
|
$array[4] = "foo";
|
|
|
|
foreach($array as $v) {
|
|
var_dump($v);
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
NULL
|
|
int(2)
|
|
NULL
|
|
NULL
|
|
string(3) "foo"
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|