Built In Types: Introduction

This section covers the different built-in types available in Hack.

Primitive Types

Hack has the following primitive types: bool, int, float, and string.

Hack Arrays

There are three types of Hack Arrays. They are: vec, keyset, and dict.

Though not built-in as types, other alternatives exist in Hack Collections.

Other Built-In Types

Hack has other built-in types too, like: enum (with enum class and enum class labels ), shape, and tuples.

Function Return Types

Other types like noreturn and void are only valid as function return types .

Special Types

These last few types are special in their utility and/or versatility: classname, dynamic, and this.

Was This Page Useful?
Thank You!
Thank You! If you'd like to share more feedback, please file an issue.