Files
doc-fr/reference/spl/splfixedarray/construct.xml
2014-09-05 20:58:33 +00:00

116 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="splfixedarray.construct" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplFixedArray::__construct</refname>
<refpurpose>Construit un nouveau <classname>SplFixedArray</classname></refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<constructorsynopsis>
<modifier>public</modifier> <methodname>SplFixedArray::__construct</methodname>
<methodparam choice="opt"><type>int</type><parameter>size</parameter><initializer>0</initializer></methodparam>
</constructorsynopsis>
<para>
Initialise un tableau fixe avec un nombre de valeurs &null;
égales au paramètre <parameter>size</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>size</parameter></term>
<listitem>
<para>
La taille du tableau à taille fixe.
Attends un nombre compris entre <literal>0</literal> et
<constant>PHP_INT_MAX</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Lance une exception <classname>InvalidArgumentException</classname>
lorsque <parameter>size</parameter> est négatif.
number.
</para>
<para>
Émets une alerte de niveau <constant>E_WARNING</constant> lorsque
<parameter>size</parameter> ne peut être analysé comme un nombre.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Exemple avec <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
-->