This error occures when you have a function or class declared more than once

Scenarios

1. I have a file with all the class declarations which I include after the header.php file. In my scenario it was not possible for me to include the class declaration file before calling the header.

Later on there was a need to access the class functions within the header file. When I included the class within the header.php file, I got this error as the class declaration happened twice.

2. In rare occasions there can be a class name declared more than once.

Solutions

1. Using  multiple includes: Class or functions file can be included multiple times.

2. Using IF statement:

 

Leave a Reply

Your email address will not be published. Required fields are marked *