mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 15:12:23 +01:00
123 lines
3.1 KiB
XML
123 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: eb39dbdba6ddeb7b70741ba44b37bf3394f198cb Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
|
|
<refentry xml:id="splfixedarray.setsize" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>SplFixedArray::setSize</refname>
|
|
<refpurpose>Altera o tamanho de um array</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="SplFixedArray">
|
|
<modifier>public</modifier> <type>true</type><methodname>SplFixedArray::setSize</methodname>
|
|
<methodparam><type>int</type><parameter>size</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Altera o tamanho de um array para o novo tamanho especificado por <parameter>size</parameter>. Se
|
|
<parameter>size</parameter> for menor que o tamanho atual do array, quaisquer valores após o novo tamanho
|
|
serão descartados. Se <parameter>size</parameter> for maior que o tamanho atual do array, o array será
|
|
preenchido com valores &null;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>size</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O novo tamanho do array. Isso deve ser um valor entre <literal>0</literal> e <constant>PHP_INT_MAX</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
&return.true.always;
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<simpara>
|
|
Lança <exceptionname>ValueError</exceptionname> quando
|
|
<parameter>size</parameter> for menor que zero.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.4.0</entry>
|
|
<entry>
|
|
<methodname>SplFixedArray::setSize</methodname>
|
|
agora tem um tipo de retorno provisório de <type>true</type>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>SplFixedArray::setSize</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$array = new SplFixedArray(5);
|
|
echo $array->getSize()."\n";
|
|
$array->setSize(10);
|
|
echo $array->getSize()."\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
5
|
|
10
|
|
]]>
|
|
</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
|
|
-->
|