Some time ago, due to an accident at the time of a debug I realized that PHP is not case sensitive at the time of a function call.
Example:
print_r($teste);
print_R($teste);
Print_R($teste);
The same thing happens for the methods of the class:
$fileIterator = new FileSystemIterator(__DIR__);
$fileIterator->current();
$fileIterator->Current();
foreach ($fileIterator as $file) {
echo $file->getRealPath();
echo $file->getRealpath();
echo $file->GETREALPATH();
}
To find out what the original name of the getRealPath
method was, I used get_class_methods
in FileSystemIterator
. And the result was:
[32] => getRealPath
And in the PHP Manual, too.
The question is: even though case-insensitive , because of having a "default name" defined for methods and functions, should I bother writing them exactly as they are in the manual?
For my memory, I know that FileSystemIterator
has a method called getRealPath
, but sometimes I forget how to spell (if it is getRealPath
or getRealpath
), and, because it works, I leave it the way that's it.
Should I worry about this "writing" at the time of the method call?