From:             james dot zimmerman at trnxs dot net
Operating system: Linux (Ubuntu 9.04)
PHP version:      5.2.10
PHP Bug Type:     CGI related
Bug description:  PHP CLI (php -a) does not function correctly on include and 
related functions.

Description:
------------
Discovered first trying to utilize Zend_Http_Client from the interactive
PHP command line.  Any include call using CLI interactive mode will always
report the boolean return value of the include operation, regardless of
whether a return() statement is included or not in the included file.  A
more precise description would be that if you attempt to run Example #5
from the include() description page
(http://us3.php.net/manual/en/function.include.php), it will echo two "11"
and not the expected "PHP1".  This does not appear to affect simply running
the file as an argument to the php command, ie "$ php testreturns.php",
only the interactive CLI mode (php -a).

Reproduce code:
---------------
Interactive shell

php > $foo = include 'return.php';
php > $bar = include 'noreturn.php';
php > echo $foo;
1
php > echo $bar;
1
php > exit


Expected result:
----------------
Should have echoed "PHP" when echoing the $foo variable.

php > echo $foo;
PHP
php > echo $bar;
1

Actual result:
--------------
php > echo $foo;
1
php > echo $bar;
1

-- 
Edit bug report at http://bugs.php.net/?id=49405&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49405&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49405&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49405&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49405&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49405&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49405&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49405&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49405&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49405&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49405&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49405&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49405&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49405&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49405&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49405&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49405&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49405&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49405&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49405&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49405&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49405&r=mysqlcfg

Reply via email to