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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sskaje at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 12:01:29 2024 UTC