svn: /phpdoc/en/trunk/language/ operators.xml
| From: | Bob Weinand | Date: | Mon, 25 Jul 2016 08:51:14 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/ operators.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-14357@lists.php.net to get a copy of this message | ||
bwoebi Mon, 25 Jul 2016 08:51:14 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=339711
Log:
Follow-up for last commit, missing information about the isset-like behavior
Changed paths:
U phpdoc/en/trunk/language/operators.xml
Modified: phpdoc/en/trunk/language/operators.xml
===================================================================
--- phpdoc/en/trunk/language/operators.xml 2016-07-25 08:43:12 UTC (rev 339710)
+++ phpdoc/en/trunk/language/operators.xml 2016-07-25 08:51:14 UTC (rev 339711)
@@ -1612,7 +1612,7 @@
<sect2 xml:id="language.operators.comparison.coalesce">
<title>Null Coalescing Operator</title>
<para>
- Further exists the "??" (or null coalesce) operator, available as of PHP 7.
+ Further exists the "??" (or null coalescing) operator, available as of PHP 7.
<example>
<title>Assigning a default value</title>
<programlisting role="php">
@@ -1636,9 +1636,14 @@
<replaceable>expr2</replaceable> if <replaceable>expr1</replaceable>
is
&null;, and <replaceable>expr1</replaceable> otherwise.
</para>
+ <para>
+ In particular, this operator does not emit a notice if the left-hand side
+ value does not exist, just like <function>isset</function>. This is especially
+ useful on array keys.
+ </para>
<note>
<simpara>
- Please note that the ternary operator is an expression, and that it
+ Please note that the null coalescing operator is an expression, and that it
doesn't evaluate to a variable, but to the result of an expression. This
is important to know if you want to return a variable by reference.
The statement <literal>return $foo ?? $bar;</literal> in a
@@ -1648,7 +1653,7 @@
</note>
<note>
<simpara>
- Please note that the null coalesce operator allows for simple nesting:
+ Please note that the null coalescing operator allows for simple nesting:
<example>
<title>Non-obvious Ternary Behaviour</title>
<programlisting role="php">