php错误无法重新声明类

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.

The util.php requires the MainPage.php and Form.php.

Use require_once 'DatabaseHandler.php' instead of require 'DatabaseHandler.php'.

This should work!