If you are trying to find a file on your include path, there is a better way: http://php.net/manual/en/function.stream-resolve-include-path.php
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
get_include_path — Obtém a opção de configuração include_path atual
Retorna o caminho, como uma string.
Exemplo #1 Exemplo get_include_path()
<?php
// Funciona a partir do PHP 4.3.0
echo get_include_path();
// Funciona em todas as versões do PHP
echo ini_get('include_path');
?>
If you are trying to find a file on your include path, there is a better way: http://php.net/manual/en/function.stream-resolve-include-path.php