The documentation on this is rather vague, the little that exists does not clearly clarify the difference between the use and purpose of the following two PHP constants:
PATH_SEPARATOR
and
DIRECTORY_SEPARATOR
At first glance, it seems that both give us the same practical application, that is, detect the path separator in the operating system, for example /
or \
.
But the fact that there are both constants tells me soon that this will not be true, two things would not have been created for the same exact effect!
Reading what is present in the manual in PHP: Predefined Constants - Manual , I see:
Predefined Constants
The counters below are defined by this extension and will only be available when the extension was compiled with PHP or loaded dynamically during execution.
DIRECTORY_SEPARATOR (string)
PATH_SEPARATOR (string)
That is, I see nothing, not even a small description of the constant is present.
If you are going to see PHP: Predefined Constants - Manual (English) , it speaks in ;
and ,
!?
Question
What is the difference between the two constants and their practical use for each?