Hack Documentation


  • Overview

    A quick introduction to some of Hack's major features.
  • Getting Started

    Five simple steps to installing Hack, and making your first program.
  • Tools

    Tools to help you build Hack apps, like Nuclide - our IDE - or PHP to Hack migration helpers.
  • FAQ

    Common information and questions around Hack.
  • Types

    Introducing typing of parameters, variables, and return values, to prevent errors and make code more readable.
  • Async

    Hack introduces async programming to PHP, letting your apps scale better and reduce blocking.
  • Collections

    Improving upon PHP’s arrays with Vectors, Sets, Maps, and other Collections.
  • XHP

    An easily reusable and customizable UI system that automatically handles escaping and XSS protection.
  • Typechecker

    The bread and butter tool of Hack to ensure code type safety.
  • Shapes

    Adding structure and type-checking to arrays used as structs or records.
  • Tuples

    Bundle together values of possibly different types.
  • Enums

    First-class enumeration types.
  • Generics

    Code that works with multiple types and is type safe.
  • Type Aliases

    Create complex type structures with type aliases
  • Lambdas

    A simplified closure syntax.
  • Type Constants

    An alternative to generics with types declared as members of a class.
  • Attributes

    Decorate classes and methods with meta information.
  • Operators

    Hack has various operators like null-safe and lambda.
  • Callables

    An alternative to the PHP callable typehint.
  • Other Features

    Various other Hack features like constructor parameter promotion.
  • Unsupported

    Hack doesn't support some common PHP features and idioms.

API Reference

Full reference docs for all functions, classes, interfaces, and traits in the Hack language.