mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Rewrite SPL Types
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@312828 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9212a0e064
commit
1ca585d841
14 changed files with 714 additions and 607 deletions
|
@ -20,6 +20,7 @@
|
|||
<!-- }}} -->
|
||||
|
||||
&reference.spl-types.setup;
|
||||
&reference.spl-types.spltype;
|
||||
&reference.spl-types.splint;
|
||||
&reference.spl-types.splfloat;
|
||||
&reference.spl-types.splenum;
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.splbool" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<phpdoc:classref xml:id="class.splbool" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The SplBool class</title>
|
||||
<titleabbrev>SplBool</titleabbrev>
|
||||
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ splbool intro -->
|
||||
|
||||
<!-- {{{ SplBool intro -->
|
||||
<section xml:id="splbool.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
|
@ -14,33 +16,123 @@
|
|||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<section xml:id="splbool.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SplBool</classname></ooclass>
|
||||
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>SplBool</classname>
|
||||
</ooclass>
|
||||
|
||||
<ooclass>
|
||||
<modifier>extends</modifier>
|
||||
<classname>SplEnum</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splbool')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>boolean</type>
|
||||
<varname linkend="splbool.constants.default">SplBool::__default</varname>
|
||||
<initializer>false</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>boolean</type>
|
||||
<varname linkend="splbool.constants.false">SplBool::false</varname>
|
||||
<initializer>false</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>boolean</type>
|
||||
<varname linkend="splbool.constants.true">SplBool::true</varname>
|
||||
<initializer>true</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splenum')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
</classsynopsis>
|
||||
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ SplBool constants -->
|
||||
<section xml:id="splbool.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="splbool.constants.types">
|
||||
<title>SplBool Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="splbool.constants.default">
|
||||
<term><constant>SplBool::__default</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="splbool.constants.false">
|
||||
<term><constant>SplBool::false</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="splbool.constants.true">
|
||||
<term><constant>SplBool::true</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<!-- {{{ examples -->
|
||||
<section xml:id="splbool.examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><classname>SplBool</classname> usage example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$true = new SplBool(true);
|
||||
if ($true) {
|
||||
echo "TRUE\n";
|
||||
}
|
||||
|
||||
$false = new SplBool;
|
||||
if ($false) {
|
||||
echo "FALSE\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
TRUE
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.spl-types.entities.splbool;
|
||||
</phpdoc:classref>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
<?xml version='1.0' encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry xml:id="splbool.construct" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>SplBool::__construct</refname>
|
||||
<refpurpose>Constructs a bool object type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis>
|
||||
<methodname>SplBool::__construct</methodname>
|
||||
<void />
|
||||
</constructorsynopsis>
|
||||
<para>
|
||||
This constructs a new object of type bool.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>input</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>input</parameter> parameter accepts a <type>bool</type>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>strict</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A <type>boolean</type> variable to indicate whether the object's
|
||||
strictness should be set or not.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>SplBool::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$one = new SplBool(true);
|
||||
$two = new SplBool(1);
|
||||
|
||||
var_dump($one);
|
||||
var_dump($two);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
object(SplBool)#1 (1) {
|
||||
["__default"]=>
|
||||
bool(true)
|
||||
}
|
||||
object(SplBool)#1 (1) {
|
||||
["__default"]=>
|
||||
bool(true)
|
||||
}
|
||||
]]>
|
||||
</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
|
||||
-->
|
|
@ -1,12 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.splenum" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<phpdoc:classref xml:id="class.splenum" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The SplEnum class</title>
|
||||
<titleabbrev>SplEnum</titleabbrev>
|
||||
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ splenum intro -->
|
||||
|
||||
<!-- {{{ SplEnum intro -->
|
||||
<section xml:id="splenum.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
|
@ -15,33 +17,118 @@
|
|||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<section xml:id="splenum.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SplEnum</classname></ooclass>
|
||||
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<modifier>abstract</modifier> <classname>SplEnum</classname>
|
||||
<classname>SplEnum</classname>
|
||||
</ooclass>
|
||||
|
||||
<ooclass>
|
||||
<modifier>extends</modifier>
|
||||
<classname>SplType</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>NULL</type>
|
||||
<varname linkend="splenum.constants.default">SplEnum::__default</varname>
|
||||
<initializer>null</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splenum')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splenum')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.spltype')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
</classsynopsis>
|
||||
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ SplEnum constants -->
|
||||
<section xml:id="splenum.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="splenum.constants.types">
|
||||
<title>SplEnum Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="splenum.constants.default">
|
||||
<term><constant>SplEnum::__default</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<!-- {{{ examples -->
|
||||
<section xml:id="splenum.examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><classname>SplEnum</classname> usage example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Month extends SplEnum {
|
||||
const __default = self::January;
|
||||
|
||||
const January = 1;
|
||||
const February = 2;
|
||||
const March = 3;
|
||||
const April = 4;
|
||||
const May = 5;
|
||||
const June = 6;
|
||||
const July = 7;
|
||||
const August = 8;
|
||||
const September = 9;
|
||||
const October = 10;
|
||||
const November = 11;
|
||||
const December = 12;
|
||||
}
|
||||
|
||||
echo new Month(Month::June) . PHP_EOL;
|
||||
|
||||
try {
|
||||
new Month(13);
|
||||
} catch (UnexpectedValueException $uve) {
|
||||
echo $uve->getMessage() . PHP_EOL;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
6
|
||||
Value not a const in enum Month
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.spl-types.entities.splenum;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
<?xml version='1.0' encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry xml:id="splenum.construct" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>SplEnum::__construct</refname>
|
||||
<refpurpose>Constructs an enumeration object type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis>
|
||||
<methodname>SplEnum::__construct</methodname>
|
||||
<void />
|
||||
</constructorsynopsis>
|
||||
<para>
|
||||
This constructor is used to set the value and the strictness of the
|
||||
enumeration object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>input</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>input</parameter> parameter accepts an <type>integer</type>
|
||||
and will throw an <classname>UnexpectedValueException</classname> if anything else is passed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>strict</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A <type>boolean</type> variable to indicate whether the object's
|
||||
strictness should be set or not.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>SplEnum::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
class EnumOne extends SplEnum
|
||||
{
|
||||
const __default = 1;
|
||||
}
|
||||
|
||||
class EnumTwo extends SplEnum
|
||||
{
|
||||
const __default = 2;
|
||||
}
|
||||
|
||||
class EnumThree extends SplEnum
|
||||
{
|
||||
const __default = 3;
|
||||
}
|
||||
|
||||
$enumOne = new EnumOne();
|
||||
$enumTwo = new EnumTwo();
|
||||
$enumThree = new EnumThree();
|
||||
|
||||
|
||||
echo 'Enum one : ' . $enumOne . PHP_EOL;
|
||||
echo 'Enum two : ' . $enumTwo . PHP_EOL;
|
||||
echo 'Enum three: ' . $enumThree . PHP_EOL;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Enum one : 1
|
||||
Enum two : 2
|
||||
Enum three: 3
|
||||
]]>
|
||||
</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
|
||||
-->
|
96
reference/spl_types/splenum/getconstlist.xml
Normal file
96
reference/spl_types/splenum/getconstlist.xml
Normal file
|
@ -0,0 +1,96 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="splenum.getconstlist" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>SplEnum::getConstList</refname>
|
||||
<refpurpose>Returns all consts (possible values) as an array.</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>array</type><methodname>SplEnum::getConstList</methodname>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>include_default</parameter><initializer>false</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>include_default</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Whether to include <literal>__default</literal> property.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>SplEnum::getConstList</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$bool = new SplBool;
|
||||
var_dump($bool->getConstList(true));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(3) {
|
||||
["__default"]=>
|
||||
bool(false)
|
||||
["false"]=>
|
||||
bool(false)
|
||||
["true"]=>
|
||||
bool(true)
|
||||
}
|
||||
]]>
|
||||
</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
|
||||
-->
|
|
@ -1,12 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.splfloat" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<phpdoc:classref xml:id="class.splfloat" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The SplFloat class</title>
|
||||
<titleabbrev>SplFloat</titleabbrev>
|
||||
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ splfloat intro -->
|
||||
|
||||
<!-- {{{ SplFloat intro -->
|
||||
<section xml:id="splfloat.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
|
@ -14,33 +16,101 @@
|
|||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<section xml:id="splfloat.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SplFloat</classname></ooclass>
|
||||
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>SplFloat</classname>
|
||||
</ooclass>
|
||||
|
||||
<ooclass>
|
||||
<modifier>extends</modifier>
|
||||
<classname>SplType</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splfloat')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>double</type>
|
||||
<varname linkend="splfloat.constants.default">SplFloat::__default</varname>
|
||||
<initializer>0</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.spltype')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
</classsynopsis>
|
||||
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ SplFloat constants -->
|
||||
<section xml:id="splfloat.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="splfloat.constants.types">
|
||||
<title>SplFloat Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="splfloat.constants.default">
|
||||
<term><constant>SplFloat::__default</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<!-- {{{ examples -->
|
||||
<section xml:id="splfloat.examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><classname>SplFloat</classname> usage example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$float = new SplFloat(3.154);
|
||||
$newFloat = new SplFloat(3);
|
||||
|
||||
try {
|
||||
$float = 'Try to cast a string value for fun';
|
||||
} catch (UnexpectedValueException $uve) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
||||
echo $float . PHP_EOL;
|
||||
echo $newFloat . PHP_EOL;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Value not a float
|
||||
3.154
|
||||
3
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.spl-types.entities.splfloat;
|
||||
</phpdoc:classref>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,108 +0,0 @@
|
|||
<?xml version='1.0' encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry xml:id="splfloat.construct" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>SplFloat::__construct</refname>
|
||||
<refpurpose>Constructs a float object type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis>
|
||||
<methodname>SplFloat::__construct</methodname>
|
||||
<methodparam>
|
||||
<type>float</type>
|
||||
<parameter>input</parameter>
|
||||
</methodparam>
|
||||
</constructorsynopsis>
|
||||
<para>
|
||||
This constructs a new object of type float.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>input</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>input</parameter> parameter accepts a <type>float</type>
|
||||
or an <type>integer</type>. If an <type>integer</type> is passed, it will be converted
|
||||
to <type>float</type>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>SplFloat::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$float = new SplFloat(3.154);
|
||||
$newFloat = new SplFloat(3);
|
||||
|
||||
try {
|
||||
$float = 'Try to cast a string value for fun';
|
||||
} catch (UnexpectedValueException $uve) {
|
||||
echo $uve->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
||||
var_dump($float);
|
||||
var_dump($newFloat);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Value not a float
|
||||
object(SplFloat)#1 (1) {
|
||||
["__default"]=>
|
||||
float(3.154)
|
||||
}
|
||||
object(SplFloat)#2 (1) {
|
||||
["__default"]=>
|
||||
float(3)
|
||||
}
|
||||
]]>
|
||||
</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
|
||||
-->
|
|
@ -1,12 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.splint" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<phpdoc:classref xml:id="class.splint" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The SplInt class</title>
|
||||
<titleabbrev>SplInt</titleabbrev>
|
||||
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ splint intro -->
|
||||
|
||||
<!-- {{{ SplInt intro -->
|
||||
<section xml:id="splint.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
|
@ -14,33 +16,98 @@
|
|||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<section xml:id="splint.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SplInt</classname></ooclass>
|
||||
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>SplInt</classname>
|
||||
</ooclass>
|
||||
|
||||
<ooclass>
|
||||
<modifier>extends</modifier>
|
||||
<classname>SplType</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splint')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="splint.constants.default">SplInt::__default</varname>
|
||||
<initializer>0</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.spltype')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
</classsynopsis>
|
||||
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ SplInt constants -->
|
||||
<section xml:id="splint.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="splint.constants.types">
|
||||
<title>SplInt Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="splint.constants.default">
|
||||
<term><constant>SplInt::__default</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<!-- {{{ examples -->
|
||||
<section xml:id="splint.examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><classname>SplInt</classname> usage example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$int = new SplInt(94);
|
||||
|
||||
try {
|
||||
$int = 'Try to cast a string value for fun';
|
||||
} catch (UnexpectedValueException $uve) {
|
||||
echo $uve->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
||||
echo $int . PHP_EOL;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Value not an integer
|
||||
94
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.spl-types.entities.splint;
|
||||
</phpdoc:classref>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
<?xml version='1.0' encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry xml:id="splint.construct" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>SplInt::__construct</refname>
|
||||
<refpurpose>Constructs an integer object type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis>
|
||||
<methodname>SplInt::__construct</methodname>
|
||||
<methodparam>
|
||||
<type>integer</type>
|
||||
<parameter>input</parameter>
|
||||
</methodparam>
|
||||
</constructorsynopsis>
|
||||
<para>
|
||||
This constructs a new object of type integer.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>input</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>input</parameter> parameter accepts an <type>integer</type>
|
||||
An <classname>UnexpectedValueException</classname> Exception will be thrown if anything is passed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>SplInt::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$int = new SplInt(94);
|
||||
|
||||
try {
|
||||
$int = 'Try to cast a string value for fun';
|
||||
} catch (UnexpectedValueException $uve) {
|
||||
echo $uve->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
||||
var_dump($int);
|
||||
echo $int; // Outputs 94
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Value not an integer
|
||||
object(SplInt)#1 (1) {
|
||||
["__default"]=>
|
||||
int(94)
|
||||
}
|
||||
94
|
||||
]]>
|
||||
</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
|
||||
-->
|
|
@ -1,12 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.splstring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The SplString class</title>
|
||||
<titleabbrev>SplString</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ splstring intro -->
|
||||
|
||||
<!-- {{{ SplString intro -->
|
||||
<section xml:id="splstring.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
|
@ -14,33 +16,103 @@
|
|||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<section xml:id="splstring.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SplString</classname></ooclass>
|
||||
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>SplString</classname>
|
||||
</ooclass>
|
||||
|
||||
<ooclass>
|
||||
<modifier>extends</modifier>
|
||||
<classname>SplType</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splstring')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="splstring.constants.default">SplString::__default</varname>
|
||||
<initializer>0</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.spltype')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
</classsynopsis>
|
||||
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ SplString constants -->
|
||||
<section xml:id="splstring.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="splstring.constants.types">
|
||||
<title>SplString Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="splstring.constants.default">
|
||||
<term><constant>SplString::__default</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<!-- {{{ examples -->
|
||||
<section xml:id="splstring.examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><classname>SplString</classname> usage example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$string = new SplString("Testing");
|
||||
|
||||
try {
|
||||
$string = array();
|
||||
} catch (UnexpectedValueException $uve) {
|
||||
echo $uve->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
||||
var_dump($string);
|
||||
echo $string; // Outputs "Testing"
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Value not a string
|
||||
object(SplString)#1 (1) {
|
||||
["__default"]=>
|
||||
string(7) "Testing"
|
||||
}
|
||||
Testing
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.spl-types.entities.splstring;
|
||||
</phpdoc:classref>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
<?xml version='1.0' encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry xml:id="splstring.construct" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>SplString::__construct</refname>
|
||||
<refpurpose>Constructs a string object type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis>
|
||||
<methodname>SplString::__construct</methodname>
|
||||
<methodparam>
|
||||
<type>string</type>
|
||||
<parameter>input</parameter>
|
||||
</methodparam>
|
||||
</constructorsynopsis>
|
||||
<para>
|
||||
This constructs a new object of type string.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>input</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>input</parameter> parameter accepts a <type>string</type>
|
||||
An <classname>UnexpectedValueException</classname> Exception will be thrown if anything else is passed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>SplString::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$string = new SplString("Testing");
|
||||
|
||||
try {
|
||||
$string = array();
|
||||
} catch (UnexpectedValueException $uve) {
|
||||
echo $uve->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
||||
var_dump($string);
|
||||
echo $string; // Outputs "Testing"
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Value not a string
|
||||
object(SplString)#1 (1) {
|
||||
["__default"]=>
|
||||
string(7) "Testing"
|
||||
}
|
||||
Testing
|
||||
]]>
|
||||
</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
|
||||
-->
|
94
reference/spl_types/spltype.xml
Normal file
94
reference/spl_types/spltype.xml
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.spltype" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The SplType class</title>
|
||||
<titleabbrev>SplType</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ SplType intro -->
|
||||
<section xml:id="spltype.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Parent class for all SPL types.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="spltype.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SplType</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<modifier>abstract</modifier> <classname>SplType</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>NULL</type>
|
||||
<varname linkend="spltype.constants.default">SplType::__default</varname>
|
||||
<initializer>null</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.spltype')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ SplType constants -->
|
||||
<section xml:id="spltype.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="spltype.constants.types">
|
||||
<title>SplType Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="spltype.constants.default">
|
||||
<term><constant>SplType::__default</constant></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.spl-types.entities.spltype;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
<!-- 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
|
||||
-->
|
68
reference/spl_types/spltype/construct.xml
Normal file
68
reference/spl_types/spltype/construct.xml
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="spltype.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>SplType::__construct</refname>
|
||||
<refpurpose>Creates a new value of some type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<methodname>SplType::__construct</methodname>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>initial_value</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>strict</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>initial_value</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Type and default value depends on the extension class.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>strict</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Whether to set the object's sctrictness.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</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
|
||||
-->
|
Loading…
Reference in a new issue