From fa568719e176d2a678f7d7511b2410ee3b792b90 Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker <cmb@php.net> Date: Wed, 22 Jun 2016 11:03:49 +0000 Subject: [PATCH] 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 --- language/oop5/properties.xml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/language/oop5/properties.xml b/language/oop5/properties.xml index 4734c517f9..1077844476 100644 --- a/language/oop5/properties.xml +++ b/language/oop5/properties.xml @@ -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>