473,378 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

require_once() not foolproof for me, still getting class redeclaration errors

Hello, I use require_once() in all my code that includes a separate
class declared inside there.

However, there are times in certain cases where I will still get a
class redeclaration error. The php error log says I'm FATAL ERROR,
can't redeclare class or something to that extent. ph34r.gif

Are there any other cases where this error might occur even while using
require_once()?

Thanks

Jul 17 '05 #1
1 1762
su******@comcast.net wrote:
Hello, I use require_once() in all my code that includes a separate
class declared inside there.

However, there are times in certain cases where I will still get a
class redeclaration error. The php error log says I'm FATAL ERROR,
can't redeclare class or something to that extent. ph34r.gif

Are there any other cases where this error might occur even while using
require_once()?

Thanks


This can happen when you are using relative paths in Windows.
--
-------------------------------------------------------
Try this: SCA the Smart Class Archive for PHP
http://www.project-sca.org
-------------------------------------------------------
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the...
1
by: Glenn | last post by:
Hi I have been hoping to use my laptop as a porta-server but ran into this problem. It seems that require_once() is not working for me! The child class file has a 'require_once()' to the parent...
6
by: Nik Coughin | last post by:
Say I have a script: http://www.mydomain.com/test/admin/foo.php That looks like this: <?php $baseDir = "http://" . $_SERVER . "/test"; require_once( $baseDir . '/helpers/helper.php' );
3
by: Sean Quinn | last post by:
Hi, I don't know if anyone has run into similar problems, but it seems like when I use `require_once(...)' with files that contain functions I get an error indicating that it can't redeclare the...
11
by: Kimmo Laine | last post by:
I'm flipping my wig here, people. I'm using classes and making each class a file. when I'm including dependet classess, I use require_once to avoid multiple declarations - yet they happen. I put...
8
by: David T. Ashley | last post by:
Hi, Does require_once() treat "file.inc" and "subdirectory/file.inc" as the same things or different? The reason for my question is that I'd like to organize my PHP library into...
6
by: Shelly | last post by:
Here is a crazy question that has happend to me once before. I have an include file for the connection information to the server. It is like this: $hostname= "the_server_location"; $database...
3
by: Peter Wang | last post by:
Hi, all. I recently encountered a very annoying problem while using Zend Framework(ZF). We use ZF in our web application, and it works fine at the beginning, but later when concurrent...
7
by: Ronald Raygun | last post by:
I have been struggling with this all afternoon and I'm, well lats just say, very pissed off ... I have a require once in a file. I am passing the fully qualified (i.e. absolute pathname) to a...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.