1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-26 08:42:13 +01:00
Files
archived-doc-ru/reference/array/functions/array-fill.xml
Sergey Panteleev 3586b1d1f2 docs(ru): Updated to English revision
git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@351864 c90b9560-bf6c-de11-be94-00142212c4b1
2020-12-04 06:44:55 +00:00

189 lines
4.8 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: cd943f94a013b74df8765ab8e1a620a916a64a85 Maintainer: shein Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xml:id="function.array-fill" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>array_fill</refname>
<refpurpose>Заполняет массив значениями</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>array_fill</methodname>
<methodparam><type>int</type><parameter>start_index</parameter></methodparam>
<methodparam><type>int</type><parameter>count</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Заполняет массив <parameter>count</parameter> элементами со значением
<parameter>value</parameter>, начиная с ключа <parameter>start_index</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>start_index</parameter></term>
<listitem>
<para>
Первый индекс возвращаемого массива.
</para>
<para>
Если <parameter>start_index</parameter> отрицателеный,
первым индексом возвращаемого массива будет
<parameter>start_index</parameter>, а последующие индексы
будут начинаться с нуля
(см. <link linkend="function.array-fill.example.basic">пример</link>).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
Количество вставляемых элементов.
Их должно быть больше или равно нулю.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
Значение для заполнения
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает заполненный массив
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Вызывает предупреждение <constant>E_WARNING</constant> в случае, если
параметр <parameter>count</parameter> меньше нуля.
</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>5.6.0</entry>
<entry>
<parameter>count</parameter> теперь может быть равен нулю. До этого
<parameter>count</parameter> должен был быть больше нуля.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example xml:id="function.array-fill.example.basic">
<title>Пример использования <function>array_fill</function></title>
<programlisting role="php">
<![CDATA[
<?php
$a = array_fill(5, 6, 'banana');
$b = array_fill(-2, 4, 'pear');
print_r($a);
print_r($b);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Array
(
[5] => banana
[6] => banana
[7] => banana
[8] => banana
[9] => banana
[10] => banana
)
Array
(
[-2] => pear
[0] => pear
[1] => pear
[2] => pear
)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<para>
Смотрите также подробное описание отрицательных ключей в разделе
<link linkend="language.types.array">Массивы</link>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>array_fill_keys</function></member>
<member><function>str_repeat</function></member>
<member><function>range</function></member>
</simplelist>
</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
-->