mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
ec67e42ba8
commit
fa568719e1
1 changed files with 11 additions and 5 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue