I have three classes DatabaseHandler, MainPage, and Form
DatabaseHandler.php
class DatabaseHandler extends DatabaseConnection
{
}
MainPage.php
require 'DatabaseHandler.php'
class MainPage
{
}
Form.php
require 'DatabaseHandler.php'
class Form
{
}
on this util.php file it throws an error "cannot redeclare class"
//util.php
require 'MainPage.php';
require 'Form.php';
how can I avoid this error, i searched before and it says that the only solution is "namespace", i tried reading about it but Im confused and i dont know how to apply it on my situation.