mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Document constant arrays in the migration guide.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@335317 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7506ffce44
commit
5ac4f93fd0
1 changed files with 24 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
|||
<title>New features</title>
|
||||
|
||||
<sect2 xml:id="migration56.new-features.const-scalar-exprs">
|
||||
<title>Constant scalar expressions</title>
|
||||
<title>Constant expressions</title>
|
||||
|
||||
<para>
|
||||
It is now possible to provide a scalar expression involving numeric and
|
||||
|
@ -41,6 +41,29 @@ echo C::SENTENCE;
|
|||
<![CDATA[
|
||||
4
|
||||
The value of THREE is 3
|
||||
]]>
|
||||
</screen>
|
||||
</informalexample>
|
||||
|
||||
<para>
|
||||
It is also now possible to define a constant <type>array</type> using the
|
||||
<literal>const</literal> keyword:
|
||||
</para>
|
||||
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
const ARR = ['a', 'b'];
|
||||
|
||||
echo ARR[0];
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
a
|
||||
]]>
|
||||
</screen>
|
||||
</informalexample>
|
||||
|
|
Loading…
Reference in a new issue