Doc #72468 [NEW]: heredoc seem actually supported in static declarations

From: Date: Wed, 22 Jun 2016 09:14:32 +0000
Subject: Doc #72468 [NEW]: heredoc seem actually supported in static declarations
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13579@lists.php.net to get a copy of this message
From: info at developiu dot it Operating system: centos linux PHP version: 7.0.7 Package: Documentation problem Bug Type: Documentation Problem Bug description:heredoc seem actually supported in static declarations Description: ------------ This bug is similar to bug #70227, but it is related to a different page. the page at url http://php.net/manual/en/language.oop5.properties.php states the following (see Example #1 property declarations): "Unlike heredocs, nowdocs can be used in any static data context, including property declarations." This seem to imply that that heredocs are not allowed in static context but allowed in non static context, but the write proably meant that they always disallowed, as explicitated by the previous example, where the definition of $var2 is marked as invalid even if it is not static. Actually heredocs can be used to define properties, as the script below shows (with the same syntax marked as invalid in the example given in the documentation abow the "incriminated" phrase). If you run it you'll see no error. BTW: is there a way for me to propose a patch to some file in order to minimize your work on fixing these sort of bugs? Test script: --------------- <?php error_reporting(E_ALL); class SimpleClass { public $var2 = <<<EOD hello world EOD; } $a=new SimpleClass(); echo $a->var2; ?> -- Edit bug report at https://bugs.php.net/bug.php?id=72468&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72468&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72468&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72468&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72468&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72468&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72468&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72468&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72468&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72468&r=support Expected behavior: https://bugs.php.net/fix.php?id=72468&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72468&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72468&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72468&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72468&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72468&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72468&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72468&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72468&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72468&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72468&r=mysqlcfg

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