기타 __halt_compiler
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
__halt_compiler — 컴파일러 실행 중지
설명
__halt_compiler(): void
컴파일러의 실행을 중지합니다. 이것은 설치 파일과 같은 PHP 스크립트에 데이터를 포함하는 데 유용할 수 있습니다.
데이터 시작의 바이트 위치는 파일에 __halt_compiler()가 있는 경우에만 정의되는 __COMPILER_HALT_OFFSET__
상수에 의해 결정될 수 있습니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
값이 반환되지 않습니다.
Examples
예제 #1 __halt_compiler() 예제
<?php
// open this file
$fp = fopen(__FILE__, 'r');
// seek file pointer to data
fseek($fp, __COMPILER_HALT_OFFSET__);
// and output it
var_dump(stream_get_contents($fp));
// the end of the script execution
__halt_compiler(); the installation data (eg. tar, gz, PHP, etc.)
메모
참고: __halt_compiler()는 가장 바깥쪽 범위에서만 사용할 수 있습니다.