Doc #70031 [Opn->Csd]: require_once returns an incorrect value the second time

From: Date: Thu, 09 Jul 2015 13:37:04 +0000
Subject: Doc #70031 [Opn->Csd]: require_once returns an incorrect value the second time
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12503@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70031&edit=1 ID: 70031 Updated by: cmb@php.net Reported by: php_bugs at multiwebinc dot com Summary: require_once returns an incorrect value the second time -Status: Open +Status: Closed Type: Documentation Problem Package: *General Issues PHP Version: 5.6.10 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2015-07-09 13:36:05] cmb@php.net Automatic comment from SVN on behalf of cmb Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=337130 Log: include_once returns TRUE when including the same file repeatedly (fixes #70031) ------------------------------------------------------------------------ [2015-07-08 23:53:31] php_bugs at multiwebinc dot com 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 this bug report at https://bugs.php.net/bug.php?id=70031&edit=1

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