php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43930 echo "Blah".require("file.php")."\n";
Submitted: 2008-01-24 20:18 UTC Modified: 2008-01-25 07:52 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Jille at quis dot cx Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.5 OS: FreeBSD 6.2
Private report: No CVE-ID: None
 [2008-01-24 20:18 UTC] Jille at quis dot cx
Description:
------------
Well, as said in the Summary (sorry, couldn't make a normal sentence of it)

echo "Blah".require("file.php")."\n";
tries to include "file.php\n";

If parentheses are used after a language construct, I`d expect it to "end reading" the (eg) filename there.

Reproduce code:
---------------
<?PHP
  echo "Blah".require("file.php")."\n";
?>

Expected result:
----------------
like:
<?PHP
  echo "Blah".(require("file.php"))."\n";
?>

include file.php, and don't give a parse error


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-25 07:52 UTC] colder@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.

Don't use parentheses with language constructs that don't need them. They give a false sense of precedence.

require("foo")."bar" is executed like require "foo"."bar";

Another example: print (2*2)+3; is supposed to print 7 and not 4.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Aug 25 21:00:02 2026 UTC