[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    Re: [DOC-CVS] svn: /phpdoc/en/trunk/language/ constants.xml
From:       Peter Cowburn <petercowburn () gmail ! com>
Date:       2017-09-14 11:26:16
Message-ID: CAPg3Xx+eMfY_Z2ybJbEjHGxUPvX4QHYSb12UjLR-R5UU7Z=t+A () mail ! gmail ! com
[Download RAW message or body]


On 14 September 2017 at 11:38, Remi Collet <remi@php.net> wrote:

> remi                                     Thu, 14 Sep 2017 10:38:27 +0000
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=343088
>
> Log:
> Array constant only allowed in 7+
>
> Changed paths:
>     U   phpdoc/en/trunk/language/constants.xml
>
> Modified: phpdoc/en/trunk/language/constants.xml
> ===================================================================
> --- phpdoc/en/trunk/language/constants.xml      2017-09-14 08:27:38 UTC
> (rev 343087)
> +++ phpdoc/en/trunk/language/constants.xml      2017-09-14 10:38:27 UTC
> (rev 343088)
> @@ -75,7 +75,7 @@
>      only scalar data (<type>boolean</type>, <type>integer</type>,
>      <type>float</type> and <type>string</type>) can be contained
>      in constants prior to PHP 5.6. From PHP 5.6 onwards, it is possible to
> -    define a constant as a scalar expression, and it is also possible
> +    define a constant as a scalar expression, and from PHP 7 it is also
> possible
>

This paragraph starts with "When using the const keyword ...", and the
preceding paragraph states, "the const keyword has restrictions as outlined
in the next paragraph."
Your change does not make sense in this context, the old description (being
able to do "const FOO = array('a', 'b', 'c');" as of PHP 5.6.0) was correct.

It would be good to mention the PHP 7.0.0 change (to allow "define('FOO',
array('a', 'b', 'c'));") on this page, but that was not the correct place
to do it.


>      to define an <type>array</type> constant. It is possible to define
>      constants as a <type>resource</type>, but it should be avoided, as it
> can
>      cause unexpected results.
>
>
> --
> PHP Documentation Commits Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic