svn: /phpdoc/en/trunk/language/oop5/ properties.xml
| From: | Christoph Michael Becker | Date: | Wed, 22 Jun 2016 11:03:49 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/oop5/ properties.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-14230@lists.php.net to get a copy of this message | ||
cmb Wed, 22 Jun 2016 11:03:49 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=339448
Log:
Fix #72468: heredoc seem actually supported in static declarations
Bug: https://bugs.php.net/72468 (Verified) heredoc seem
actually supported in static declarations
Changed paths:
U phpdoc/en/trunk/language/oop5/properties.xml
Modified: phpdoc/en/trunk/language/oop5/properties.xml
===================================================================
--- phpdoc/en/trunk/language/oop5/properties.xml 2016-06-22 08:25:56 UTC (rev 339447)
+++ phpdoc/en/trunk/language/oop5/properties.xml 2016-06-22 11:03:49 UTC (rev 339448)
@@ -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 @@
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 @@
</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.
@@ -114,6 +117,9 @@
public $bar = <<<'EOT'
bar
EOT;
+ public $baz = <<<EOT
+baz
+EOT;
}
?>
]]>
@@ -122,7 +128,7 @@
</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>