|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-10 11:37 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ when I use include("http://".$_SERVER['HTTP_HOST']."/bread.php"); and include("bread.php"); the include found both files. But when I try to instantiate an instance of an class in bread.php, only include("bread.php"); works??????? the reason I am using $_server variable is to have an absolute path for file at different subdirectories to call bread.php Reproduce code: --------------- //include("http://".$_SERVER['HTTP_HOST']."/bread.php"); include("bread.php"); $b =new bread(); echo $b->trace($ctid, $pctid); //works fine but if I use include("http://".$_SERVER['HTTP_HOST']."/bread.php"); //include("bread.php"); $b =new bread(); echo $b->trace($ctid, $pctid);\ //I got the error in the following section. Expected result: ---------------- no error Actual result: -------------- Fatal error: Cannot instantiate non-existent class: bread in /hsphere/local/home/developm/hsc.development.complexusgroup.com/common/header.php on line 67