#49405 [Opn->Csd]: PHP CLI (php -a) does not function correctly on include and related functions.
ID: 49405
Updated by: jani@php.net
Reported By: james dot zimmerman at trnxs dot net
-Status: Open
+Status: Closed
Bug Type: CGI related
Operating System: Linux (Ubuntu 9.04)
PHP Version: 5.2.10
Previous Comments:
------------------------------------------------------------------------
[2009-08-31 12:07:28] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=287915
Log: MF53: - Fixed bug #49000 (PHP CLI in Interactive mode (php -a)
crashes when including files from function), see also bug #49405
------------------------------------------------------------------------
[2009-08-28 23:11:56] james dot zimmerman at trnxs dot net
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 this bug report at http://bugs.php.net/?id=49405&edit=1
Thread (2 messages)