Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

What is the best method, to change the previously declared function into the new one?

for example, there is already declared:

function smth(){
echo 'aaa';
}

and i want that it displayed not aaa, but bbb

function smth(){
echo 'bbb';
}

but when i insert the new function (inside functions.php), i get error message

(Fatal error: Cannot redeclare **smth()** (previously declared in ... )



UPDATE - I have found a solution:

http://stackoverflow.com/a/8125517/2165415https://stackoverflow.com/a/8125517/2165415

What is the best method, to change the previously declared function into the new one?

for example, there is already declared:

function smth(){
echo 'aaa';
}

and i want that it displayed not aaa, but bbb

function smth(){
echo 'bbb';
}

but when i insert the new function (inside functions.php), i get error message

(Fatal error: Cannot redeclare **smth()** (previously declared in ... )



UPDATE - I have found a solution:

http://stackoverflow.com/a/8125517/2165415

What is the best method, to change the previously declared function into the new one?

for example, there is already declared:

function smth(){
echo 'aaa';
}

and i want that it displayed not aaa, but bbb

function smth(){
echo 'bbb';
}

but when i insert the new function (inside functions.php), i get error message

(Fatal error: Cannot redeclare **smth()** (previously declared in ... )



UPDATE - I have found a solution:

https://stackoverflow.com/a/8125517/2165415

Post Closed as "Not suitable for this site" by tfrommen, fuxia
added 99 characters in body
Source Link
T.Todua
  • 5.9k
  • 9
  • 51
  • 79

What is the best method, to change the previously declared function into the new one?

for example, there is already declared:

function smth(){
echo 'aaa';
}

and i want that it displayed not aaa, but bbb

function smth(){
echo 'bbb';
}

but when i insert the new function (inside functions.php), i get error message

(Fatal error: Cannot redeclare **smth()** (previously declared in ... )



UPDATE - I have found a solution:

http://stackoverflow.com/a/8125517/2165415

What is the best method, to change the previously declared function into the new one?

for example, there is already declared:

function smth(){
echo 'aaa';
}

and i want that it displayed not aaa, but bbb

function smth(){
echo 'bbb';
}

but when i insert the new function (inside functions.php), i get error message

(Fatal error: Cannot redeclare **smth()** (previously declared in ... )

What is the best method, to change the previously declared function into the new one?

for example, there is already declared:

function smth(){
echo 'aaa';
}

and i want that it displayed not aaa, but bbb

function smth(){
echo 'bbb';
}

but when i insert the new function (inside functions.php), i get error message

(Fatal error: Cannot redeclare **smth()** (previously declared in ... )



UPDATE - I have found a solution:

http://stackoverflow.com/a/8125517/2165415

Source Link
T.Todua
  • 5.9k
  • 9
  • 51
  • 79

Redeclare function (override)

What is the best method, to change the previously declared function into the new one?

for example, there is already declared:

function smth(){
echo 'aaa';
}

and i want that it displayed not aaa, but bbb

function smth(){
echo 'bbb';
}

but when i insert the new function (inside functions.php), i get error message

(Fatal error: Cannot redeclare **smth()** (previously declared in ... )