Questions tagged [redeclare]
79 questions
39
votes
2 answers
Cannot redeclare function php
I have a function called parseDate, but when i call it on my php page (it's a joomla component page) I get Fatal error: Cannot redeclare parsedate() (previously declared in templates/ja_zeolite/assets/functions.php:2) in…

pindol
- 2,110
- 6
- 35
- 52
11
votes
3 answers
function inside function in php: error: Cannot redeclare
I have this php script:
function hoeveelzijner ($jaar, $id)
{
function hoeveelhoeveel($beginstamp, $endstamp, $id)
{
$dates = mysql_query('SELECT v_date FROM visitors WHERE id="'.$id.'" AND…

binoculars
- 2,226
- 5
- 33
- 61
5
votes
1 answer
What's the most correct way around this propel "Cannot redeclare function" error?
I have the following tables:
user, logbook, user_logbook
User logbook is a junction table (isCrossRef="true" in the schema.xml), containing user_id and logbook_id foreign keys.
I also wanted to remember the currently selected logbook for any given…

LeonardChallis
- 7,759
- 6
- 45
- 76
4
votes
0 answers
PHPUnit loads all classes at once. Causes PHP Fatal error: Cannot redeclare class
I've done my due diligence, but I don't think any of the questions so far have touched on this problem.
I have a situation where my PHP code generates class definitions based on config properties.
The class definitions are basically data holders and…

chrism
- 41
- 1
- 3
4
votes
1 answer
Cannot redeclare a function previously declared
After I have instaled in my site one script, I have an error:
Fatal error: Cannot redeclare ae_detect_ie() (previously declared in /home/xdesign/public_html/Powerful/config.php:24) in /home/xdesign/public_html/Powerful/config.php on line 29
This is…

Cindy SeoLine
- 51
- 1
- 1
- 3
3
votes
1 answer
PHP OOP redeclare private method/function in child class
Inside php manual example http://php.net/manual/en/language.oop5.visibility.php#example-242 it is saying
We can redeclare the public and protected method, but not private
what do they mean my that i might not be getting how to use inheritance…

Roman Toasov
- 747
- 11
- 36
3
votes
0 answers
Fatal Error: Cannot Redeclare class (despite using require_once)
I understand that similar questions have been asked. However, none of the solutions I found can solve my problem.
I am using the Avada WordPress theme. I have created a customized page for a table list that requires me to connect to the database to…

Ben Chin
- 31
- 6
3
votes
1 answer
Cannot redeclare class Magento
I have an interesting issue. The front-end of my website loads fine, however when I try to navigate to:
domain.com/index.php/admin
I get a white page. I have enabled debugging mode and it displays this error:
Array ( [type] => 64 [message] => Cannot…

Charlie Coplestone
- 385
- 4
- 18
2
votes
4 answers
Workaround for cannot redeclare?
I just finished getting this script working and I need to use it multiple times in the same page. However, when I use it a second time I get the error Fatal error: Cannot redeclare get_names() (previously declared. I looked around for an answer but…

user1206214
- 63
- 1
- 7
2
votes
1 answer
Why does a redeclared private variable in an extended class is not recognised by a function but a redeclared protected one is in a PHP object?
If I make a mother class, with some private variable declared, and some function that uses that private value, and then extend it into a daughter class, redeclaring that private variable, the mentioned function will still use the private variable of…

algo
- 108
- 1
- 11
2
votes
1 answer
How to 'undeclare' a custom function in a loop
I am collecting a series of php files and testing to see if a single function returns valid output. To facilitate the process, all their functions are named identically. So then I can run:
foreach($fileList as $file) {
require($file);
…

George
- 29
- 8
2
votes
2 answers
confusing "cannot redeclare class" error (PHP)
I have a strange issue. I have a static method that loads classes (load_library). When it loads a particular class, it gives me a "cannot redeclare class" fatal error, but when testing whether the class exists right before using the load_library…

dqhendricks
- 19,030
- 11
- 50
- 83
2
votes
5 answers
Cannot redeclare config() error in cakePHP
I am getting the error Fatal error: Cannot redeclare config() (previously declared in.../basics.php:58, in live server. It works fine in my local server but when i uploaded the site to live server, i got the fatal error.
I checked if the config()…

Sudhir Bastakoti
- 99,167
- 15
- 158
- 162
2
votes
0 answers
PHP 5.5 Azure - Cannot redeclare function previously declared in ... (same place)
We host a php application on Azure, it runs on php 5.5 and uses the wincache extension provided by Azure.
We have a couple of random failures to load (no error just blank output) per week in the application normally fixed by a restart.
Today we had…

Gavin
- 2,153
- 2
- 25
- 35
2
votes
2 answers
The bug Fatal error: Cannot redeclare date_diff() in
I used cakephp with version 1.1.7692.
When i run it with php ver > 5.3.2, it has bug :
Fatal error: Cannot redeclare date_diff().
and i run it with php ver 5.2.9, it display very text and code same as :
quality = 100; $thumb->fileName =…

Hyeongsik
- 125
- 1
- 3
- 7