[DOC-CVS] [doc-en] master: Fix example output (screen) inconsistent with code (#5600)
[email protected] (Louis-Arnaud via GitHub) Mon, 15 Jun 2026 17:46:21 +0000
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Louis-Arnaud (lacatoire) Committer: GitHub (web-flow) Pusher: jordikroon Date: 2026-06-15T19:46:18+02:00 Commit: https://github.com/php/doc-en/commit/df78bd1d232f2cd8df673accf5ba0e280695639b Raw diff: https://github.com/php/doc-en/commit/df78bd1d232f2cd8df673accf5ba0e280695639b.diff Fix example output (screen) inconsistent with code (#5600) * Fix example output (screen) inconsistent with code Co-authored-by: Jordi Kroon <[email protected]> Changed paths: M language/oop5/inheritance.xml M reference/datetime/functions/mktime.xml M reference/dom/domelement/construct.xml M reference/ds/ds/map/ksort.xml M reference/ds/ds/map/ksorted.xml M reference/ds/ds/map/pairs.xml M reference/ds/ds/pair/clear.xml M reference/ds/ds/vector/join.xml M reference/memcached/memcached/fetch.xml M reference/mongodb/functions/bson/fromphp.xml M reference/mongodb/mongodb/driver/cursor.xml M reference/spl/splobjectstorage/rewind.xml M reference/uri/uri/whatwg/url/getquery.xml M reference/wincache/functions/wincache-ucache-delete.xml M reference/yaf/yaf-config-ini.xml M reference/yar/examples.xml Diff: diff --git a/language/oop5/inheritance.xml b/language/oop5/inheritance.xml index ff14dbe1d56e..445fa5930463 100644 --- a/language/oop5/inheritance.xml +++ b/language/oop5/inheritance.xml @@ -97,9 +97,9 @@ class Bar extends Foo $foo = new Foo(); $bar = new Bar(); $foo->printItem('baz'); // Output: 'Foo: baz' -$foo->printPHP(); // Output: 'PHP is great' +$foo->printPHP(); // Output: 'PHP is great.' $bar->printItem('baz'); // Output: 'Bar: baz' -$bar->printPHP(); // Output: 'PHP is great' +$bar->printPHP(); // Output: 'PHP is great.' ?> ]]> diff --git a/reference/datetime/functions/mktime.xml b/reference/datetime/functions/mktime.xml index 5ffdaa5ea933..6ba3db618b29 100644 --- a/reference/datetime/functions/mktime.xml +++ b/reference/datetime/functions/mktime.xml @@ -254,11 +254,11 @@ print date('c', $nextyear) . "\n"; <para> <example> <title>Last day of a month</title> - <para> + <simpara> The last day of any given month can be expressed as the "0" day of the next month, not the -1 day. Both of the following examples - will produce the string "The last day in Feb 2000 is: 29". - </para> + will produce the string "Last day in Feb 2000 is: 29". + </simpara> <programlisting role="php"> <![CDATA[ <?php diff --git a/reference/dom/domelement/construct.xml b/reference/dom/domelement/construct.xml index ecce38ee78ab..af58339d6fa9 100644 --- a/reference/dom/domelement/construct.xml +++ b/reference/dom/domelement/construct.xml @@ -68,7 +68,7 @@ $dom = new DOMDocument('1.0', 'iso-8859-1'); $element = $dom->appendChild(new DOMElement('root')); $element_ns = new DOMElement('pr:node1', 'thisvalue', 'http://xyz'); $element->appendChild($element_ns); -echo $dom->saveXML(); /* <?xml version="1.0" encoding="utf-8"?> +echo $dom->saveXML(); /* <?xml version="1.0" encoding="iso-8859-1"?> <root><pr:node1 xmlns:pr="http://xyz">thisvalue</pr:node1></root> */ ?> diff --git a/reference/ds/ds/map/ksort.xml b/reference/ds/ds/map/ksort.xml index 1d5342953744..c5614fce1460 100644 --- a/reference/ds/ds/map/ksort.xml +++ b/reference/ds/ds/map/ksort.xml @@ -15,9 +15,9 @@ <modifier>public</modifier> <type>void</type><methodname>Ds\Map::ksort</methodname> <methodparam choice="opt"><type>callable</type><parameter>comparator</parameter></methodparam> </methodsynopsis> - <para> + <simpara> Sorts the map in-place by key, using an optional <parameter>comparator</parameter> function. - </para> + </simpara> </refsect1> @@ -35,9 +35,9 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; - <para> + <simpara> &return.void; - </para> + </simpara> </refsect1> <refsect1 role="examples"> @@ -101,7 +101,6 @@ print_r($map); <screen> <![CDATA[ Ds\Map Object -Ds\Map Object ( [0] => Ds\Pair Object ( diff --git a/reference/ds/ds/map/ksorted.xml b/reference/ds/ds/map/ksorted.xml index 91add0371179..dc12b7be4b6c 100644 --- a/reference/ds/ds/map/ksorted.xml +++ b/reference/ds/ds/map/ksorted.xml @@ -13,9 +13,9 @@ <modifier>public</modifier> <type>Ds\Map</type><methodname>Ds\Map::ksorted</methodname> <methodparam choice="opt"><type>callable</type><parameter>comparator</parameter></methodparam> </methodsynopsis> - <para> + <simpara> Returns a copy sorted by key, using an optional <parameter>comparator</parameter> function. - </para> + </simpara> </refsect1> @@ -33,9 +33,9 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; - <para> + <simpara> Returns a copy of the map, sorted by key. - </para> + </simpara> </refsect1> <refsect1 role="examples"> @@ -55,7 +55,6 @@ print_r($map->ksorted()); <screen> <![CDATA[ Ds\Map Object -Ds\Map Object ( [0] => Ds\Pair Object ( @@ -99,7 +98,6 @@ print_r($sorted); <screen> <![CDATA[ Ds\Map Object -Ds\Map Object ( [0] => Ds\Pair Object ( diff --git a/reference/ds/ds/map/pairs.xml b/reference/ds/ds/map/pairs.xml index 470b099105b0..c34a0749af8d 100644 --- a/reference/ds/ds/map/pairs.xml +++ b/reference/ds/ds/map/pairs.xml @@ -47,7 +47,7 @@ var_dump($map->pairs()); &example.outputs.similar; <screen> <![CDATA[ -object(Ds\Map)#8 (3) { +object(Ds\Vector)#8 (3) { [0]=> object(Ds\Pair)#5 (2) { ["key"]=> @@ -70,7 +70,6 @@ object(Ds\Map)#8 (3) { int(3) } } -p ]]> </screen> </example> diff --git a/reference/ds/ds/pair/clear.xml b/reference/ds/ds/pair/clear.xml index 044d540e3b81..37651d88c694 100644 --- a/reference/ds/ds/pair/clear.xml +++ b/reference/ds/ds/pair/clear.xml @@ -50,9 +50,8 @@ print_r($pair); <![CDATA[ Ds\Pair Object ( - [0] => 1 - [1] => 2 - [2] => 3 + [key] => a + [value] => 1 ) Ds\Pair Object ( diff --git a/reference/ds/ds/vector/join.xml b/reference/ds/ds/vector/join.xml index 6b8c4dcaf05b..2d07479405d0 100644 --- a/reference/ds/ds/vector/join.xml +++ b/reference/ds/ds/vector/join.xml @@ -73,7 +73,7 @@ var_dump($vector->join()); &example.outputs.similar; <screen> <![CDATA[ -string(11) "abc123" +string(6) "abc123" ]]> </screen> </example> diff --git a/reference/memcached/memcached/fetch.xml b/reference/memcached/memcached/fetch.xml index e0b2ac88f6cc..04bf6411ffac 100644 --- a/reference/memcached/memcached/fetch.xml +++ b/reference/memcached/memcached/fetch.xml @@ -60,7 +60,7 @@ while ($result = $m->fetch()) { array(3) { ["key"]=> string(3) "int" - "value"]=> + ["value"]=> int(99) ["cas"]=> float(2363) diff --git a/reference/mongodb/functions/bson/fromphp.xml b/reference/mongodb/functions/bson/fromphp.xml index b1b2506c5da7..d7d45261bc52 100644 --- a/reference/mongodb/functions/bson/fromphp.xml +++ b/reference/mongodb/functions/bson/fromphp.xml @@ -100,7 +100,7 @@ echo bin2hex($bson), "\n"; &example.outputs; <screen> <![CDATA[ -0e00000010666f6f000100000000cat +0e00000010666f6f000100000000 ]]> </screen> </example> diff --git a/reference/mongodb/mongodb/driver/cursor.xml b/reference/mongodb/mongodb/driver/cursor.xml index 1005ad4a66a4..c1edfc430563 100644 --- a/reference/mongodb/mongodb/driver/cursor.xml +++ b/reference/mongodb/mongodb/driver/cursor.xml @@ -145,7 +145,7 @@ stdClass Object [name] => Vesta [size] => 525 [distance] => 2.362 -} +) ]]> </screen> </example> diff --git a/reference/spl/splobjectstorage/rewind.xml b/reference/spl/splobjectstorage/rewind.xml index d41f2e302f87..a0699e6d92d8 100644 --- a/reference/spl/splobjectstorage/rewind.xml +++ b/reference/spl/splobjectstorage/rewind.xml @@ -61,8 +61,12 @@ while($s->valid()) { &example.outputs.similar; <screen> <![CDATA[ -int(1) -int(0) +object(stdClass)#2 (0) { +} +string(2) "d1" +object(stdClass)#3 (0) { +} +string(2) "d2" ]]> </screen> </example> diff --git a/reference/uri/uri/whatwg/url/getquery.xml b/reference/uri/uri/whatwg/url/getquery.xml index 5435a414d9c0..889a815f15fb 100644 --- a/reference/uri/uri/whatwg/url/getquery.xml +++ b/reference/uri/uri/whatwg/url/getquery.xml @@ -44,7 +44,7 @@ echo $url->getQuery(); &example.outputs; <screen> <![CDATA[ -foo=bar +foo/bar ]]> </screen> </example> diff --git a/reference/wincache/functions/wincache-ucache-delete.xml b/reference/wincache/functions/wincache-ucache-delete.xml index 51fad10b2b93..f88438023594 100644 --- a/reference/wincache/functions/wincache-ucache-delete.xml +++ b/reference/wincache/functions/wincache-ucache-delete.xml @@ -85,7 +85,7 @@ var_dump(wincache_ucache_delete($array2)); <screen> <![CDATA[ array(4) { [0]=> string(5) "green" - [1]=> string(4) "Blue" + [1]=> string(4) "blue" [2]=> string(6) "yellow" [3]=> string(4) "cyan" } ]]> diff --git a/reference/yaf/yaf-config-ini.xml b/reference/yaf/yaf-config-ini.xml index c5a5fcf01940..d2dafe5debf2 100644 --- a/reference/yaf/yaf-config-ini.xml +++ b/reference/yaf/yaf-config-ini.xml @@ -151,7 +151,7 @@ var_dump($config->get("database.params.username")); <![CDATA[ string(15) "dev.example.com" string(6) "dbname" -string(7) "devuser +string(7) "devuser" ]]> </screen> </example> diff --git a/reference/yar/examples.xml b/reference/yar/examples.xml index b558cbd50e3e..c816785a962f 100644 --- a/reference/yar/examples.xml +++ b/reference/yar/examples.xml @@ -78,7 +78,7 @@ var_dump($client->add(1, 2)); var_dump($client->call("add", array(3, 2))); -/* __add can not be called */ +/* _add cannot be called */ var_dump($client->_add(1, 2)); ?> ]]>