mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Clarify what types of values can be given to declare directives.
Fixes doc bug #68177 (declare() + named constant = "Cannot convert to ordinal value"). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@335128 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0b93d1fa3a
commit
285c8b2b89
1 changed files with 19 additions and 0 deletions
|
@ -36,6 +36,25 @@ declare (directive)
|
|||
The encoding directive was added in PHP 5.3.0
|
||||
</simpara>
|
||||
</note>
|
||||
<para>
|
||||
As directives are handled as the file is being compiled, only literals may
|
||||
be given as directive values. Variables and constants cannot be used. To
|
||||
illustrate:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// This is valid:
|
||||
declare(ticks=1);
|
||||
|
||||
// This is invalid:
|
||||
const TICK_VALUE = 1;
|
||||
declare(ticks=TICK_VALUE);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
The <literal>statement</literal> part of the
|
||||
<literal>declare</literal> block will be executed - how
|
||||
|
|
Loading…
Reference in a new issue