Doc #70227 [Opn->Csd]: Define consts with heredocs/nowdocs

From: Date: Mon, 10 Aug 2015 12:51:49 +0000
Subject: Doc #70227 [Opn->Csd]: Define consts with heredocs/nowdocs
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12597@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70227&edit=1 ID: 70227 Updated by: cmb@php.net Reported by: dpa-bugs at aegee dot org Summary: Define consts with heredocs/nowdocs -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2015-08-10 12:50:33] cmb@php.net Automatic comment from SVN on behalf of cmb Revision: http://svn.php.net/viewvc/?view=revision&revision=337388 Log: updated manual wrt. Heredoc support for initializing consts and static members (fixes #70227) ------------------------------------------------------------------------ [2015-08-10 12:21:26] dpa-bugs at aegee dot org Description: ------------ --- From manual page: http://www.php.net/language.types.string --- The above page states under Heredocs: " As of PHP 5.3.0, it's possible to initialize static variables and class properties/constants using the Heredoc syntax:" Example #4 Using Heredoc to initialize static values" The example shows how to use heredoc to put data in const member. But under nowdocs it states: "Unlike heredocs, nowdocs can be used in any static data context. The typical example is initializing class properties or constants: Example #7 Static data example" Then http://php.net/manual/en/language.oop5.constants.php repeats "Unlike heredocs, nowdocs can be used in any static data context. " The contradition is that Example 4 demonstrates how to use heredoc to store data in const member, but the text describes this as not allowed. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70227&edit=1

« previous php.doc.bugs (#12597) next »