php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70031 require_once returns an incorrect value the second time
Submitted: 2015-07-08 23:53 UTC Modified: 2015-07-09 13:37 UTC
From: php_bugs at multiwebinc dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: 5.6.10 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php_bugs at multiwebinc dot com
New email:
PHP Version: OS:

 

 [2015-07-08 23:53 UTC] 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)
*/


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-09 13:36 UTC] 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-09 13:37 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-07-09 13:37 UTC] cmb@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 14:01:33 2024 UTC