php-doc-en/reference/pthreads/threaded/chunk.xml
Peter Cowburn 637c29c81a pthreads svn:eol-style
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@336885 c90b9560-bf6c-de11-be94-00142212c4b1
2015-06-08 22:24:49 +00:00

111 lines
2.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="threaded.chunk" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Threaded::chunk</refname>
<refpurpose>Manipulation</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>Threaded::chunk</methodname>
<methodparam><type>integer</type><parameter>size</parameter></methodparam>
<methodparam><type>boolean</type><parameter>preserve</parameter></methodparam>
</methodsynopsis>
<para>
Fetches a chunk of the objects property table of the given size, optionally preserving keys
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>size</parameter></term>
<listitem>
<para>
The number of items to fetch
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>preserve</parameter></term>
<listitem>
<para>
Preserve the keys of members, by default false
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
An array of items from the objects property table
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Fetch a chunk of the property table</title>
<programlisting role="php">
<![CDATA[
<?php
$safe = new Threaded();
while (count($safe) < 10) {
$safe[] = count($safe);
}
var_dump($safe->chunk(5));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(5) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
[4]=>
int(4)
}
]]>
</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
-->