PHP 4.0 Bug #6977 Updated: strange twist of the parser

From: Date: Thu, 05 Oct 2000 22:00:55 +0000
Subject: PHP 4.0 Bug #6977 Updated: strange twist of the parser
Groups: php.dev 
Request: Send a blank email to php-dev+get-34299@lists.php.net to get a copy of this message
ID: 6977 Updated by: stas Reported By: lanzz@graffiti.net Status: Closed Bug Type: Scripting Engine problem Assigned To: Comments: 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"). Previous Comments: --------------------------------------------------------------------------- [2000-10-02 17:34:43] lanzz@graffiti.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. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6977

« previous php.dev (#34299) next »