
ReflectionFiber::getExecutingFile 메소드는 현재 실행 중인 PHP 파일의 경로를 반환합니다. 이 메소드는 PHP 7.4.13 버전부터 사용할 수 있습니다.
getExecutingFile 메소드는 string 타입의 값을 반환하며, 현재 실행 중인 PHP 파일의 전체 경로를 포함한 파일명을 반환합니다.
예를 들어, 현재 실행 중인 PHP 파일이 /var/www/html/index.php 인 경우, getExecutingFile 메소드는 /var/www/html/index.php 를 반환합니다.
getExecutingFile 메소드를 사용하여 현재 실행 중인 파일명을 가져오려면 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$executingFile = ReflectionFiber::getExecutingFile();
echo $executingFile; // /var/www/html/index.php
이러한 방법으로, ReflectionFiber::getExecutingFile 메소드를 사용하여 현재 실행 중인 파일명을 가져올 수 있습니다.
2025-08-10 06:45