I would like some help to better understand the logic of this situation below.
A parent file makes an include of another file that contains only one class .
/main-file.php:
require_once('/other-file.php');
new ExampleNameClass( 'arg1', basename( 'arg2' ) );
/other-file.php:
if( !class_exists('ExampleNameClass') ) {
class ExampleNameClass {
[...]
As far as I understand, the file that declares the class will only get into the condition if the NO class does not exist (!class_exists)...
. But it does not really exist , so I found this condition unnecessary.
Could someone clarify why the person did it this way? Is there anything related to security?