svn: /phpdoc/en/trunk/language/ constants.xml

From: Date: Sun, 01 Jun 2014 22:06:02 +0000
Subject: svn: /phpdoc/en/trunk/language/ constants.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-12510@lists.php.net to get a copy of this message
aharvey Sun, 01 Jun 2014 22:06:02 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=333675 Log: Update constants documentation for 5.6. Changed paths: U phpdoc/en/trunk/language/constants.xml Modified: phpdoc/en/trunk/language/constants.xml =================================================================== --- phpdoc/en/trunk/language/constants.xml 2014-06-01 21:58:38 UTC (rev 333674) +++ phpdoc/en/trunk/language/constants.xml 2014-06-01 22:06:02 UTC (rev 333675) @@ -70,9 +70,10 @@ <simpara> Only scalar data (<type>boolean</type>, <type>integer</type>, <type>float</type> and <type>string</type>) can be contained - in constants. It is possible to define constants as a - <type>resource</type>, but it should be avoided, as it can cause - unexpected results. + in constants prior to PHP 5.6. From PHP 5.6 onwards, it is also possible + 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. </simpara> <simpara> You can get the value of a constant by simply specifying its name. @@ -131,7 +132,8 @@ </listitem> <listitem> <simpara> - Constants may only evaluate to scalar values. + Constants may only evaluate to scalar values, or scalar or array values + in PHP 5.6 and later. </simpara> </listitem> </itemizedlist> @@ -162,6 +164,11 @@ const CONSTANT = 'Hello World'; echo CONSTANT; + +// Works as of PHP 5.6.0 +const ANOTHER_CONST = CONSTANT.'; Goodbye World'; + +echo ANOTHER_CONST; ?> ]]> </programlisting>

« previous php.doc.cvs (#12510) next »