php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16150 include_once Broken?
Submitted: 2002-03-18 13:30 UTC Modified: 2002-08-17 14:57 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: dcourey at wizardcomputer dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.1.2 OS: Apache/1.3.23 (Unix) PHP/4.1.2 m
Private report: No CVE-ID: None
 [2002-03-18 13:30 UTC] dcourey at wizardcomputer dot com
It seems that the "include_once" function no longer works?

<?php
include_once("http://www.mySite.com/getUserID");
include_once("http://www.mySite.com/getUserID");
?>

"getUserID" contains something to the effect of...

<?php
function getID()
{
    //create empty array
    $id = array();
.......
    return ($id);
}
?>

Upon execution of the second "include_once" you'll receive an error....

Fatal error: Cannot redeclare getID() in http://www.mySite.com/getUserID on line 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-19 04:17 UTC] sander@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php


 [2002-03-19 10:55 UTC] sander@php.net
Sorry, I misread the report.
include_once() shouldn't open and include the file twice.

Anyway, you shouldn't use include_once to grab data from a remote file, use fopen() & co for that.
 [2002-03-19 12:01 UTC] dcourey at wizardcomputer dot com
Well, actually we are not retrieving data from a remote file, we are executing external script (which I believe is the primary purpose of "include_once"). The full qualified URL simply circumvents the relative path issues!!
 [2002-08-17 14:57 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 20:01:30 2025 UTC