|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-10-02 17:34 UTC] lanzz at graffiti dot net
<?
print("one-".include("test.inc")."-two");
?>
Warning: Failed opening 'test.inc-two' for inclusion (include_path='.:/usr/local/lib/php') in
...BLABLABLA.../test.php on line 3
one-
----------------------------------------------------
how the hell did the "-two" got concatenated to
"test.inc"? i know that include is not a function but a special statement, but it is described as "include()" in the documentation, which led me to believe that it DOES take into account the parentheses, but suddenly the catenation takes precedence over the include statement. this behavior doesn't seem sane, at least.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 11 20:00:01 2026 UTC |
This is because include is tatement, not function. You can say include "foo" (without parens) for example. So, your code is paresed as include [("test.inc")."-two"]. Try doing "one-".(include("test.inc"))."-two").