I'm having an issue where I'm require_once a class and I'm getting the fatal error
Fatal error: Cannot redeclare class AdminClass in /var/www/ov-admin/include/adminclass.php on line 3
I've traced the problem to when I call one of it's functions
require_once('include/adminclass.php') ;
$AdminClass = new AdminClass() ;
I call it in the index file and in the sidebar and header template includes I use the class.
Here's an example in my header.php which I include on all pages
$num_reports = $AdminClass->getNumReports() ;
but if i change it to
$num_reports = "WTF";
the error goes away.
What makes no sense to me is that it's worked until just recently. I even reverted back to the previous version to make sure my new code wasn't causing the problem and that didn't appear to be the case. Why would just using the class object try to make it redeclare the class?