From:             mailling at gmx dot co dot uk
Operating system: Windows 2000
PHP version:      4CVS-2003-08-16 (stable)
PHP Bug Type:     Scripting Engine problem
Bug description:  include doesn't return the right value

Description:
------------
It seems that the variable returned by a correct insert changed from the
last PHP version. Is it a change in the behavior or a bug?
If I include a file and everything is fine, it returns NULL, but it should
return 1 or true (it does true, but the documentation says 1)

Reproduce code:
---------------
// The file base.inc.php exists, base.inc.php2 doesn't

$a = require_once(PROJECT_BASE . '/include/base.inc.php');
$b = require_once(PROJECT_BASE . '/include/base.inc.php');
$c = include_once(PROJECT_BASE . '/include/base.inc.php2');
var_dump($a); // return NULL
var_dump($b); // return true
var_dump($c); // return false

Expected result:
----------------
true (or 1?)
true (or 1?)
false

Actual result:
--------------
NULL
true
false

-- 
Edit bug report at http://bugs.php.net/?id=25108&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25108&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25108&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25108&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25108&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25108&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25108&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25108&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25108&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25108&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25108&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25108&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25108&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25108&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25108&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25108&r=gnused

Reply via email to