language/functions.xml
f94d903985119d3ac00f4528551df947f57b667f
...
...
@@ -318,6 +318,13 @@ echo makecoffee();
318
318
echo makecoffee(array("cappuccino", "lavazza"), "teapot");?>
319
319
]]>
320
320
</programlisting>
321
+
&example.outputs;
322
+
<screen>
323
+
<![CDATA[
324
+
Making a cup of cappuccino with hands.
325
+
Making a cup of cappuccino, lavazza with teapot.
326
+
]]>
327
+
</screen>
321
328
</example>
322
329
</para>
323
330
<para>
...
...
@@ -328,12 +335,12 @@ echo makecoffee(array("cappuccino", "lavazza"), "teapot");?>
328
335
<?php
329
336
class DefaultCoffeeMaker {
330
337
public function brew() {
331
-
return 'Making coffee.';
338
+
return "Making coffee.\n";
332
339
}
333
340
}
334
341
class FancyCoffeeMaker {
335
342
public function brew() {
336
-
return 'Crafting a beautiful coffee just for you.';
343
+
return "Crafting a beautiful coffee just for you.\n";
337
344
}
338
345
}
339
346
function makecoffee($coffeeMaker = new DefaultCoffeeMaker)
...
...
@@ -345,6 +352,14 @@ echo makecoffee(new FancyCoffeeMaker);
345
352
?>
346
353
]]>
347
354
</programlisting>
355
+

356
+
&example.outputs;
357
+
<screen>
358
+
<![CDATA[
359
+
Making coffee.
360
+
Crafting a beautiful coffee just for you.
361
+
]]>
362
+
</screen>
348
363
</example>
349
364
</para>
350
365
<simpara>
...
...
@@ -1029,7 +1044,7 @@ $func(); // prints "bar"
1029
1044
In contrast, a <classname>TypeError</classname> is emitted in strict mode.
1030
1045
</para>
1031
1046

1032
-
<example>
1047
+
<informalexample>
1033
1048
<programlisting role="php">
1034
1049
<![CDATA[
1035
1050
<?php
...
...
@@ -1043,7 +1058,7 @@ var_dump(str_contains("foobar", null));
1043
1058
?>
1044
1059
]]>
1045
1060
</programlisting>
1046
-
</example>
1061
+
</informalexample>
1047
1062
</note>
1048
1063

1049
1064
<sect2 role="seealso">
...
...
@@ -1676,7 +1691,7 @@ $privateMethod(); // Foo1::privateMethod
1676
1691
<note>
1677
1692
<para>
1678
1693
The first-class callable syntax cannot be combined with the <link linkend="language.oop5.basic.nullsafe">nullsafe operator</link>. Both of the following result in a compile-time error:
1679
-
<example>
1694
+
<informalexample>
1680
1695
<programlisting role="php">
1681
1696
<![CDATA[
1682
1697
<?php
...
...
@@ -1685,7 +1700,7 @@ $obj?->prop->method(...);
1685
1700
?>
1686
1701
]]>
1687
1702
</programlisting>
1688
-
</example>
1703
+
</informalexample>
1689
1704
</para>
1690
1705
</note>
1691
1706
</sect1>
1692
1707