ID:               41114
 Updated by:       [EMAIL PROTECTED]
 Reported By:      danishzahoor at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Program Execution
 Operating System: Linux
 PHP Version:      4.4.6
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

(And there is no parse error as the < is part of a string)


Previous Comments:
------------------------------------------------------------------------

[2007-04-17 20:03:21] moron at industrial dot org

include_once is *not* a function so you cannot use it in the way you
are attempting to.  The brackets are optional so you are really just
telling PHP:

include_once "lib/file.php" . "<BR>";

i.e. concatenate the stuff at the right then include the contents of
the named file.

That said, the parser should probably raise an error since technically
your code is malformed due to the bracket in the middle.

So if there is any bug, it is the parser not complaining about the
syntax error.

Cheers

------------------------------------------------------------------------

[2007-04-17 10:43:48] danishzahoor at gmail dot com

Description:
------------
Anything string that comes after concat operator will be concaticated
in string param of include_once function.

Reproduce code:
---------------
<?php

        print "Including file from lib first<BR>";
        echo "result = " . include_once("lib/file.php") . "<BR>";
        test1();

        function test1()
        {
                print "Including file from lib inside function.<BR>";
                print "result = " . include_once("lib/file.php") . "<BR>";
        }
        
?>

Actual result:
--------------
PHP 4
=====
Including file from lib first

Warning: main(lib/file.php
): failed to open stream: No such file or directory in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 4

Warning: main(): Failed opening 'lib/file.php<BR>' for inclusion
(include_path='.:/usr/local/php/lib/php') in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 4
result = Including file from lib inside function.

Warning: test1(lib/file.php
): failed to open stream: No such file or directory in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 10

Warning: test1(): Failed opening 'lib/file.php<BR>' for inclusion
(include_path='.:/usr/local/php/lib/php') in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 10
result = 

PHP 5
=====
Including file from lib first

Warning: include_once(lib/file.php<BR>) [function.include-once]: failed
to open stream: No such file or directory in
/var/webuser/php.samnan/temp/test_include_once.php on line 4

Warning: include_once() [function.include]: Failed opening
'lib/file.php<BR>' for inclusion
(include_path='./:/usr/local/php/lib/php') in
/var/webuser/php.samnan/temp/test_include_once.php on line 4
result = Including file from lib inside function.

Warning: include_once(lib/file.php<BR>) [function.include-once]: failed
to open stream: No such file or directory in
/var/webuser/php.samnan/temp/test_include_once.php on line 10

Warning: include_once() [function.include]: Failed opening
'lib/file.php<BR>' for inclusion
(include_path='./:/usr/local/php/lib/php') in
/var/webuser/php.samnan/temp/test_include_once.php on line 10
result = 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41114&edit=1

Reply via email to