This is more of a comment than it is a question.
Typically my development sites run on a desktop PC under Linux and Apache so I’ve always just hard-coded slashes but I’m in the midst of completely reprogramming everything to more up-to-date code.
So far so good until I decided to set up my Windows 11 laptop as a stand-by in case I have time when not actually at my office. Converting the PC to Ubuntu is not possible so I set it up with Apache and all the plug-ins and modules that my sites need but am having difficulty. There is programming that generates paths and on Linux it does so perfectly as (for example)
/internals/categories/test_array.php
but on the Windows system, the same path comes out as:
\\internals\categories\test_array.php
I am not sure why the triple slashes as there is nothing in the programming to do that but more importantly, as I’m running Apache, I would have expected DIRECTORY_SEPARATOR to use the appropriate slash for it rather than the one for the base operating system.
The bottom line, it appears that using DIRECTORY_SEPARATOR was a mistake on an Apache Web server!