12.8.1 Haxe/PHP 시작하기(Getting started with Haxe/PHP)
12.8.1 Haxe/PHP 시작하기(Getting started with Haxe/PHP)
PHP 타깃은 Haxe 프로그램을 PHP 코드로 변환합니다. --php 플래그는 PHP 7 호환 코드를 생성합니다(-D php7).
간단한 예제:
class Main {
static function main() {
trace("Hello World!");
}
}
컴파일:
haxe --main Main --php bin -D php7
웹 서버에서 bin/index.php를 서빙할 수 있습니다.