mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Heredoc in class members (bug #32554)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@183655 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
71ece1d8d3
commit
6bd1cef0b3
1 changed files with 20 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.151 $ -->
|
||||
<!-- $Revision: 1.152 $ -->
|
||||
<chapter id="language.types">
|
||||
<title>Types</title>
|
||||
|
||||
|
@ -822,6 +822,24 @@ echo 'Variables do not $expand $either';
|
|||
identifier is not found then a parse error will result with the
|
||||
line number being at the end of the script.
|
||||
</simpara>
|
||||
<para>
|
||||
It is not allowed to use heredoc syntax in initializing class members.
|
||||
Use other string syntaxes instead.
|
||||
<example>
|
||||
<title>Invalid example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class foo {
|
||||
public $bar = <<<EOT
|
||||
bar
|
||||
EOT;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</warning>
|
||||
|
||||
<para>
|
||||
|
@ -829,7 +847,7 @@ echo 'Variables do not $expand $either';
|
|||
the double-quotes. This means that you do not need to escape quotes
|
||||
in your here docs, but you can still use the escape codes listed
|
||||
above. Variables are expanded, but the same care must be taken
|
||||
when expressing complex variables inside a here doc as with
|
||||
when expressing complex variables inside a heredoc as with
|
||||
strings.
|
||||
<example>
|
||||
<title>Heredoc string quoting example</title>
|
||||
|
|
Loading…
Reference in a new issue