Doc #70031 [NEW]: require_once returns an incorrect value the second time

From: Date: Wed, 08 Jul 2015 23:53:32 +0000
Subject: Doc #70031 [NEW]: require_once returns an incorrect value the second time
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12502@lists.php.net to get a copy of this message
From: php_bugs at multiwebinc dot com Operating system: PHP version: 5.6.10 Package: *General Issues Bug Type: Documentation Problem Bug description:require_once returns an incorrect value the second time Description: ------------ --- From manual page: http://www.php.net/function.require-once --- I'm not sure if this is a documentation problem or a PHP bug. The return value for require/include/require_once/include_once should be 1 unless it was overridden in the included file. However when doing require_once/include_once *twice*, the second time around it returns bool(true) instead of int(1). Test script: --------------- <?php var_dump(include_once('include_file_test.php')); var_dump(include_once('include_file_test.php')); /* Outputs: int(1) bool(true) */ -- Edit bug report at https://bugs.php.net/bug.php?id=70031&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70031&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70031&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70031&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70031&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70031&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70031&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70031&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70031&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70031&r=support Expected behavior: https://bugs.php.net/fix.php?id=70031&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70031&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70031&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70031&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70031&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70031&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70031&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70031&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70031&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70031&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70031&r=mysqlcfg

« previous php.doc.bugs (#12502) next »