|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-08-22 06:51 UTC] cmb@php.net
-Summary: Parse error when using $this::CONSTRANT in
Heredoc
+Summary: Parse error when using $this::CONSTANT in
Heredoc
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2019-08-22 06:51 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
Description: ------------ Using {$this::CONSTANT} in Heredoc causes a parse error. Test script: --------------- <?php class A { const A = 'a'; static private $c; public function render() { return <<<EOT '{$this::$c}' '{$this::A}' EOT; } } Expected result: ---------------- {$this::A} should yield the constant value in Heredoc. Actual result: -------------- 7.0.0 - 7.1.1: Parse error: syntax error, unexpected '}', expecting '[' 5.6.0 - 5.6.30: Parse error: syntax error, unexpected '}', expecting '('