php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #40292 PHP 4.* does not support calling object methods in complex (curly) syntax
Submitted: 2007-01-30 22:08 UTC Modified: 2007-03-25 10:34 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Jonah at whalehosting dot ca Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Jonah at whalehosting dot ca
New email:
PHP Version: OS:

 

 [2007-01-30 22:08 UTC] Jonah at whalehosting dot ca
Description:
------------
PHP 4.* does not support calling object methods in the complex (curly) syntax.  The doc page at http://php.net/string does not have any version information for the complex syntax.

Reproduce code:
---------------
class foobar{
    function bar(){
        echo 'blah';
    }
}

$foo = new foobar();

echo <<<EOD
    <br /> this does NOT work on PHP 4.*: {$foo->bar()}
EOD;


Expected result:
----------------
PHP 5.1.6 prints 'blah' as expected.

Actual result:
--------------
PHP 4.4.0 and 4.4.4 print this error:

Parse error: syntax error, unexpected '(', expecting '}' in ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-25 10:34 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Functions and method calls works since PHP 5."
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Feb 26 01:00:01 2026 UTC