However, based on my understanding, dirname(dirname(__FILE__)) would ascend two directories, equivalent to the www directory in the given example, not public_html. As a result, __ROOT__.'/config.php' would be equivalent to www/config.php.
I propose updating the example to accurately reflect the behavior of dirname(dirname(__FILE__)):
https://www.php.net/manual/fr/function.require-once.php
Hello,
I've identified an issue in the PHP documentation regarding the example that uses
dirname(dirname(__FILE__))
. The example is currently:However, based on my understanding,
dirname(dirname(__FILE__))
would ascend two directories, equivalent to thewww
directory in the given example, notpublic_html
. As a result,__ROOT__.'/config.php'
would be equivalent towww/config.php
.I propose updating the example to accurately reflect the behavior of
dirname(dirname(__FILE__))
:Or
Thank you for your attention to this matter.