diff --git a/reference/spl_types/book.xml b/reference/spl_types/book.xml index b23c0c7ed3..87ad59b601 100644 --- a/reference/spl_types/book.xml +++ b/reference/spl_types/book.xml @@ -20,6 +20,7 @@ &reference.spl-types.setup; + &reference.spl-types.spltype; &reference.spl-types.splint; &reference.spl-types.splfloat; &reference.spl-types.splenum; diff --git a/reference/spl_types/splbool.xml b/reference/spl_types/splbool.xml index 75112dd1df..8f27edbd57 100644 --- a/reference/spl_types/splbool.xml +++ b/reference/spl_types/splbool.xml @@ -1,12 +1,14 @@ - + + + The SplBool class SplBool - + - - + +
&reftitle.intro; @@ -14,33 +16,123 @@
- +
&reftitle.classsynopsis; - + SplBool - + SplBool + + + extends + SplEnum + - - - &Methods; - + Constants + + const + boolean + SplBool::__default + false + + + const + boolean + SplBool::false + false + + + const + boolean + SplBool::true + true + + + &InheritedMethods; + + - + +
+ + +
+ &reftitle.constants; +
+ SplBool Node Types + + + + SplBool::__default + + + + + + + SplBool::false + + + + + + + SplBool::true + + + + + + +
+
+ + + +
+ &reftitle.examples; + + + <classname>SplBool</classname> usage example + + +]]> + + &example.outputs; + + + + + +
+ +
- &reference.spl-types.entities.splbool;
- + - - - SplBool::__construct - Constructs a bool object type - - - - &reftitle.description; - - SplBool::__construct - - - - This constructs a new object of type bool. - - - - - &reftitle.parameters; - - - - input - - - The input parameter accepts a bool. - - - - - strict - - - A boolean variable to indicate whether the object's - strictness should be set or not. - - - - - - - - - &reftitle.returnvalues; - - &return.void; - - - - - &reftitle.examples; - - - <function>SplBool::__construct</function> example - - -]]> - - &example.outputs; - - - bool(true) -} -object(SplBool)#1 (1) { - ["__default"]=> - bool(true) -} -]]> - - - - - - - diff --git a/reference/spl_types/splenum.xml b/reference/spl_types/splenum.xml index 90ddf275cc..52d49390e6 100644 --- a/reference/spl_types/splenum.xml +++ b/reference/spl_types/splenum.xml @@ -1,12 +1,14 @@ - + + + The SplEnum class SplEnum - + - - + +
&reftitle.intro; @@ -15,33 +17,118 @@
- +
&reftitle.classsynopsis; - + SplEnum - + - abstract SplEnum + SplEnum + + + + extends + SplType - - + Constants + + const + NULL + SplEnum::__default + null + + &Methods; - + + + &InheritedMethods; + + - + +
+ + +
+ &reftitle.constants; +
+ SplEnum Node Types + + + + SplEnum::__default + + + + + + +
+
+ + + +
+ &reftitle.examples; + + + <classname>SplEnum</classname> usage example + +getMessage() . PHP_EOL; +} +?> +]]> + + &example.outputs; + + + + + +
+ +
&reference.spl-types.entities.splenum; +
- + - - - SplEnum::__construct - Constructs an enumeration object type - - - - &reftitle.description; - - SplEnum::__construct - - - - This constructor is used to set the value and the strictness of the - enumeration object. - - - - - &reftitle.parameters; - - - - input - - - The input parameter accepts an integer - and will throw an UnexpectedValueException if anything else is passed. - - - - - strict - - - A boolean variable to indicate whether the object's - strictness should be set or not. - - - - - - - - - &reftitle.returnvalues; - - &return.void; - - - - - &reftitle.examples; - - - <function>SplEnum::__construct</function> example - - -]]> - - &example.outputs; - - - - - - - - - diff --git a/reference/spl_types/splenum/getconstlist.xml b/reference/spl_types/splenum/getconstlist.xml new file mode 100644 index 0000000000..7fb89ea1ac --- /dev/null +++ b/reference/spl_types/splenum/getconstlist.xml @@ -0,0 +1,96 @@ + + + + + + SplEnum::getConstList + Returns all consts (possible values) as an array. + + + + &reftitle.description; + + public arraySplEnum::getConstList + boolinclude_defaultfalse + + + + + + &warn.undocumented.func; + + + + + &reftitle.parameters; + + + include_default + + + Whether to include __default property. + + + + + + + + &reftitle.returnvalues; + + + + + + + &reftitle.examples; + + + <function>SplEnum::getConstList</function> example + +getConstList(true)); +?> +]]> + + &example.outputs; + + + bool(false) + ["false"]=> + bool(false) + ["true"]=> + bool(true) +} +]]> + + + + + + + + diff --git a/reference/spl_types/splfloat.xml b/reference/spl_types/splfloat.xml index a7f5e003bb..0e3cadad79 100644 --- a/reference/spl_types/splfloat.xml +++ b/reference/spl_types/splfloat.xml @@ -1,12 +1,14 @@ - + + + The SplFloat class SplFloat - + - - + +
&reftitle.intro; @@ -14,33 +16,101 @@
- +
&reftitle.classsynopsis; - + SplFloat - + SplFloat + + + extends + SplType + - - - &Methods; - + Constants + + const + double + SplFloat::__default + 0 + + + &InheritedMethods; + + - + +
+ + +
+ &reftitle.constants; +
+ SplFloat Node Types + + + + SplFloat::__default + + + + + + +
+
+ + + +
+ &reftitle.examples; + + + <classname>SplFloat</classname> usage example + +getMessage() . PHP_EOL; +} + +echo $float . PHP_EOL; +echo $newFloat . PHP_EOL; +?> +]]> + + &example.outputs; + + + + + +
+ +
- &reference.spl-types.entities.splfloat;
- + - - - SplFloat::__construct - Constructs a float object type - - - - &reftitle.description; - - SplFloat::__construct - - float - input - - - - This constructs a new object of type float. - - - - - &reftitle.parameters; - - - - input - - - The input parameter accepts a float - or an integer. If an integer is passed, it will be converted - to float. - - - - - - - - - &reftitle.returnvalues; - - &return.void; - - - - - &reftitle.examples; - - - <function>SplFloat::__construct</function> example - -getMessage() . PHP_EOL; -} - -var_dump($float); -var_dump($newFloat); -?> -]]> - - &example.outputs; - - - float(3.154) -} -object(SplFloat)#2 (1) { - ["__default"]=> - float(3) -} -]]> - - - - - - - diff --git a/reference/spl_types/splint.xml b/reference/spl_types/splint.xml index bc5acc88fc..4f50e55dd6 100644 --- a/reference/spl_types/splint.xml +++ b/reference/spl_types/splint.xml @@ -1,12 +1,14 @@ - + + + The SplInt class SplInt - + - - + +
&reftitle.intro; @@ -14,33 +16,98 @@
- +
&reftitle.classsynopsis; - + SplInt - + SplInt + + + extends + SplType + - - - &Methods; - + Constants + + const + integer + SplInt::__default + 0 + + + &InheritedMethods; + + - + +
+ + +
+ &reftitle.constants; +
+ SplInt Node Types + + + + SplInt::__default + + + + + + +
+
+ + + +
+ &reftitle.examples; + + + <classname>SplInt</classname> usage example + +getMessage() . PHP_EOL; +} + +echo $int . PHP_EOL; +?> +]]> + + &example.outputs; + + + + + +
+ +
- &reference.spl-types.entities.splint;
- + - - - SplInt::__construct - Constructs an integer object type - - - - &reftitle.description; - - SplInt::__construct - - integer - input - - - - This constructs a new object of type integer. - - - - - &reftitle.parameters; - - - - input - - - The input parameter accepts an integer - An UnexpectedValueException Exception will be thrown if anything is passed. - - - - - - - - - &reftitle.returnvalues; - - &return.void; - - - - - &reftitle.examples; - - - <function>SplInt::__construct</function> example - -getMessage() . PHP_EOL; -} - -var_dump($int); -echo $int; // Outputs 94 -?> -]]> - - &example.outputs; - - - int(94) -} -94 -]]> - - - - - - - diff --git a/reference/spl_types/splstring.xml b/reference/spl_types/splstring.xml index c8be4120d4..558def7b99 100644 --- a/reference/spl_types/splstring.xml +++ b/reference/spl_types/splstring.xml @@ -1,12 +1,14 @@ + + The SplString class SplString - - + +
&reftitle.intro; @@ -14,33 +16,103 @@
- +
&reftitle.classsynopsis; - + SplString - + SplString + + + extends + SplType + - - - &Methods; - + Constants + + const + integer + SplString::__default + 0 + + + &InheritedMethods; + + - + +
+ + +
+ &reftitle.constants; +
+ SplString Node Types + + + + SplString::__default + + + + + + +
+
+ + + +
+ &reftitle.examples; + + + <classname>SplString</classname> usage example + +getMessage() . PHP_EOL; +} + +var_dump($string); +echo $string; // Outputs "Testing" +?> +]]> + + &example.outputs; + + + string(7) "Testing" +} +Testing +]]> + + + +
+ +
- &reference.spl-types.entities.splstring;
- + - - - SplString::__construct - Constructs a string object type - - - - &reftitle.description; - - SplString::__construct - - string - input - - - - This constructs a new object of type string. - - - - - &reftitle.parameters; - - - - input - - - The input parameter accepts a string - An UnexpectedValueException Exception will be thrown if anything else is passed. - - - - - - - - - &reftitle.returnvalues; - - &return.void; - - - - - &reftitle.examples; - - - <function>SplString::__construct</function> example - -getMessage() . PHP_EOL; -} - -var_dump($string); -echo $string; // Outputs "Testing" -?> -]]> - - &example.outputs; - - - string(7) "Testing" -} -Testing -]]> - - - - - - - diff --git a/reference/spl_types/spltype.xml b/reference/spl_types/spltype.xml new file mode 100644 index 0000000000..15d7ee2ace --- /dev/null +++ b/reference/spl_types/spltype.xml @@ -0,0 +1,94 @@ + + + + + + The SplType class + SplType + + + + +
+ &reftitle.intro; + + Parent class for all SPL types. + +
+ + +
+ &reftitle.classsynopsis; + + + + SplType + + + + + abstract SplType + + + + Constants + + const + NULL + SplType::__default + null + + + &Methods; + + + + +
+ + +
+ &reftitle.constants; +
+ SplType Node Types + + + + SplType::__default + + + + + + +
+
+ + + +
+ + &reference.spl-types.entities.spltype; + +
+ + diff --git a/reference/spl_types/spltype/construct.xml b/reference/spl_types/spltype/construct.xml new file mode 100644 index 0000000000..e8b063c9b5 --- /dev/null +++ b/reference/spl_types/spltype/construct.xml @@ -0,0 +1,68 @@ + + + + + + SplType::__construct + Creates a new value of some type + + + + &reftitle.description; + + SplType::__construct + mixedinitial_value + boolstrict + + + + + + &warn.undocumented.func; + + + + + &reftitle.parameters; + + + initial_value + + + Type and default value depends on the extension class. + + + + + strict + + + Whether to set the object's sctrictness. + + + + + + + + +