php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36823 Object method and heredoc syntax
Submitted: 2006-03-22 16:47 UTC Modified: 2006-03-22 16:55 UTC
From: berthomg at igbmc dot u-strasbg dot fr Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.2 OS: Windows xp sp2
Private report: No CVE-ID: None
 [2006-03-22 16:47 UTC] berthomg at igbmc dot u-strasbg dot fr
Description:
------------
Hello,
I have noticed that you cannot call an object method in a 
heredoc syntax, for example:

class toto {
    function method() {
        return "coucou";
    } 
}

$toto = new toto();
echo <<<EOT
toto method : {$toto->method()}
EOT;

Should ouput "toto method : coucou", yet
it outputs: Parse error: parse error, unexpected '(', expecting '}'

Is there a way to do that or not?
Thanks to all 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-22 16:55 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 07:00:01 2026 UTC