php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46658 static keywords supports in{} in heredoc
Submitted: 2008-11-24 04:29 UTC Modified: 2021-07-26 13:32 UTC
Votes:13
Avg. Score:4.0 ± 0.8
Reproduced:10 of 10 (100.0%)
Same Version:5 (50.0%)
Same OS:3 (30.0%)
From: sskaje at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: Scripting Engine problem
PHP Version: 5.3.0alpha2 OS: **
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
37 - 21 = ?
Subscribe to this entry?

 
 [2008-11-24 04:29 UTC] sskaje at gmail dot com
Description:
------------
Can static keywords like self:: parent:: ... be supported when using sth like {self::$varname} in HEREDOC ?

Reproduce code:
---------------
<?php
class static_test{
  static public $name = 'sskaje';

  static public function test()
  {
    $string = <<<HEREDOC
Hello, {self::$name};
HEREDOC;
    echo $string;
  }
}
static_test::test();

Expected result:
----------------
Hello, sskaje;

Actual result:
--------------
Notice: Undefined variable: name in G:\wwwroot\Test\static_call.php on line 8
Hello, {self::};

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:37 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2021-07-26 13:32 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-07-26 13:32 UTC] cmb@php.net
No progress for more than ten years, so I'm closing as WONTFIX.
Anybody who is still interested in this feature, please pursue the
RFC process[1].

[1] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 06:03:38 2021 UTC