Questions tagged [redeclare]
79 questions
1
vote
1 answer
PHP5.5: Fatal error: Cannot redeclare class
since I upgraded from PHP 5.2 to 5.5 I get an error I don't understand by now.
Fatal error: Cannot redeclare class sessionHandler in ... on line ...
Well before updating the PHP version this error didn't raise and redeclaring a class should be an…

user1578497
- 83
- 8
1
vote
1 answer
java. redeclare class field within class initializer and local variable within method nested block(framed braces) differences
I prepare for scjp exam and noticed surprising behaviour for me.
public class Test {
int k;
{
int k; // it is valid variant
}
public static void main(String[] args) {
int kk;
{
int kk; // NOT…

gstackoverflow
- 36,709
- 117
- 359
- 710
1
vote
3 answers
I can't compile a program due to a redeclaration
My program checks if two words are anagrams. I'm having trouble setting its value to 0. I've managed to solve the problem by using a for cycle to set all values to 0, but I would like to know if I could use int counts[26] = {0}; instead, obviously…

Matt
- 144
- 15
1
vote
1 answer
ob_end_clean not clear buffer after include
I am using this code to get module info in my CMS:
global $hook;
$hook = new bn_hookfunc;
ob_start();
include_once($mydir);
ob_end_clean();
$mod_name = $hook->call_function('module_name');
$mod_ver = $hook->call_function('module_version');
And my…

lord_viper
- 1,139
- 1
- 9
- 13
1
vote
1 answer
PHP Fatal error: Cannot redeclare class AdminImportControllerCore in
I have a script with cURL to initiate other script that import products and categories in prestashop.
This is the script which start with cURL:
define('_PS_ADMIN_DIR_',…
user2528167
1
vote
1 answer
redeclare a php-function
A normal installation of the WordPress CMS consists of hundreds of scripts, plugins and themes. The concept allows to replace scripts by simply creating a copy of it and put the altered version in the right directory.
However, a copied script will…

vincentDV
- 11
- 1
1
vote
1 answer
MYSQL output into existing HTML template
How can I output result into existing html template, using MySQL & Bash.
If I Write:
mysql --host="${VARS[6]}" --database="${VARS[9]}" --user="${VARS[7]}" \
--password="${VARS[8]}" --execute="SELECT 1 FROM table_name" \
--html…

parashutiki
- 23
- 7
1
vote
9 answers
Redeclare class in PHP
Anyone know how to redeclare function?
For example:
class Name{}
//Code here
class Name{}
And the output is:
Cannot redeclare class
So I tried to name the class as a variable:
$foo = 'name';
class $foo{}
//Code
class $foo{}
Edit: I have a…

Guy Goldenberg
- 809
- 7
- 20
1
vote
2 answers
Cannot redeclare class
PHP says "Cannot redeclare class MyClass". Of course, class is defined only once. What else can cause this error?

Suzan Cioc
- 29,281
- 63
- 213
- 385
1
vote
2 answers
Does PHP sometimes ignore function redeclarations?
I am working on a website with a few friends, and recently, users have complained about a fairly important feature doing nothing but return a blank page. This only happens for some users, while other users are able to use it perfectly fine.
I…

Neko
- 3,550
- 7
- 28
- 34
0
votes
1 answer
Instantiating a class within a recursive function in PHP
I've been creating a script using PHP and seem to have hit a brick wall at the moment with it. I'm trying to call a variable from another file which is within a class, so I went about it by including the file within the original and then…

GamingX
- 179
- 1
- 7
0
votes
2 answers
Having problems with cannot redeclare
I just finished writing this script and getting it to work but I need to use it a total of 8 times on 1 page. It works fine the first time but the second time I get: Fatal Error cannot redeclare get_names(). I've been told the way around this is to…

user1206214
- 63
- 1
- 7
0
votes
1 answer
How to stop redeclare php function issue by moving elsewhere
I basically have a PHP function that is in a giant foreach statement and needs to be in that foreach because it uses values from the loop.
foreach ($x as $y) {
...
function sortq($a, $b){
if ((int)$a->id == (int)$b->id)…

Tim
- 6,986
- 8
- 38
- 57
0
votes
2 answers
How can I undeclare DECLARE_HANDLE?
I'm porting a piece of code from VC6 to VS2008. The code typedefs HSPRITE as int. But Windows SDK 6.1 already declared HSPRITE through DECLARE_HANDLE. I don't want to rename HSPRITE in my code since it will consume a lot of time to rename it in .cpp…

Triang3l
- 1,230
- 9
- 29
0
votes
1 answer
Wordpress Admin Panel Show Fatal error: Cannot redeclare wlwmanifest_link() (previously declared in
Fatal error: Cannot redeclare wlwmanifest_link() (previously declared in /home/freefire/public_html/wp-includes/general-template.php:3382) in /home/freefire/public_html/wp-includes/deprecated.php on line 4635
How Can i Solve this. Please Help…