Fix #72468: heredoc seem actually supported in static declarations

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339448 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2016-06-22 11:03:49 +00:00
parent ec67e42ba8
commit fa568719e1

View file

@ -66,12 +66,15 @@
<?php
class SimpleClass
{
// invalid property declarations:
// valid as of PHP 5.6.0:
public $var1 = 'hello ' . 'world';
// valid as of PHP 5.3.0:
public $var2 = <<<EOD
hello world
EOD;
// valid as of PHP 5.6.0:
public $var3 = 1+2;
// invalid property declarations:
public $var4 = self::myStaticMethod();
public $var5 = $myVar;
@ -79,7 +82,7 @@ EOD;
public $var6 = myConstant;
public $var7 = array(true, false);
// This is allowed only in PHP 5.3.0 and later.
// valid as of PHP 5.3.0:
public $var8 = <<<'EOD'
hello world
EOD;
@ -99,8 +102,8 @@ EOD;
</note>
<para>
Unlike
<link linkend="language.types.string.syntax.heredoc">heredocs</link>,
As of PHP 5.3.0
<link linkend="language.types.string.syntax.heredoc">heredocs</link> and
<link linkend="language.types.string.syntax.nowdoc">nowdocs</link>
can be used in any static data context, including property
declarations.
@ -113,6 +116,9 @@ class foo {
// As of PHP 5.3.0
public $bar = <<<'EOT'
bar
EOT;
public $baz = <<<EOT
baz
EOT;
}
?>
@ -122,7 +128,7 @@ EOT;
</para>
<note>
<para>
Nowdoc support was added in PHP 5.3.0.
Nowdoc and Heredoc support was added in PHP 5.3.0.
</para>
</note>
</sect1>