PHPackages                             fredemmott/hack-error-suppressor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fredemmott/hack-error-suppressor

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

fredemmott/hack-error-suppressor
================================

Suppress HHVM's automatic conversion of typechecker errors to fatals.

v1.0.1(9y ago)2506.8k—8.8%21ISCHack

Since Jan 23Pushed 7y agoCompare

[ Source](https://github.com/fredemmott/hack-error-suppressor)[ Packagist](https://packagist.org/packages/fredemmott/hack-error-suppressor)[ RSS](/packages/fredemmott-hack-error-suppressor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

INACTIVE PROJECT
================

[](#inactive-project)

THIS PROJECT IS NO LONGER ACTIVE; it is not needed with HHVM 3.25 and later.

Hack Error Suppressor [![Build Status](https://camo.githubusercontent.com/5c751aef5130754c623ac29b4bd99bd870afc3762320c4d4c7906f17caa68013/68747470733a2f2f7472617669732d63692e6f72672f66726564656d6d6f74742f6861636b2d6572726f722d73757070726573736f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fredemmott/hack-error-suppressor)
=====================================================================================================================================================================================================================================================================================================================================================

[](#hack-error-suppressor-)

Unless the `hhvm.hack.lang.look_for_typechecker` ini setting is set to false, by default HHVM will try to run the typechecker when loading any Hack files, and raise a catchable runtime fatal error.

This is a PHP library that makes it convenient to temporarily disable this behavior.

When This Is Useful
-------------------

[](#when-this-is-useful)

HHVM's behavior is problematic when:

- HHVM can't work out where the project root is - for example, if you're trying to run Hack code from a composer plugin
- If your Hack code needs to operate on an incomplete project - for example, if you wish to write Hack code to fetch dependencies
- If your Hack code needs to operate on known-bad projects - for example, when updating generated code, the code may be inconsistent while your codegen is in process

When You Shouldn't Use This
---------------------------

[](#when-you-shouldnt-use-this)

It's probably not appropriate if any of these are true:

- it's used outside of a build/install or codegen process
- it's used when *using* generated code
- it's called during normal use of your software, rather than just by developers
- it's used outside of the CLI

Typechecker errors are real problems with code, and mean that things *are*broken; ignoring enforcement is only a good idea if you are expecting your code to be running on a temporarily-broken codebase, and your code fixes it.

Installation
------------

[](#installation)

```
$ composer require fredemmott/hack-error-suppressor

```

Usage
-----

[](#usage)

You must enable error suppression before any Hack code is loaded.

You can explicitly enable and disable the suppression:

```
