Hack

1 program Added 2025-10-22T09:54:13Z Model: anthropic/claude-3.5-sonnetTemp: 0.4 Evidence Report issue View issues
Aliases: Hack PHP
Provenance: commit 1b8908402c · authored 2025-10-22T11:54:13+02:00 · model anthropic/claude-3.5-sonnet

Sources mentioning this language

8 sources · pl_id: pl/hack
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q59

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: imperative · functional · object-oriented · procedural · reflective
Typingdynamic, weak, gradual
Designed byThe PHP Development Team · Zend Technologies · PHP Foundation · Rasmus Lerdorf
First appeared1995
Influenced byPerl · C · C++ · Java · Tcl · JavaScript
LicenseModified BSD License
Implemented inC (primarily · some components in C++)
Homepagehttps://thephp.foundation

Extensions claimed by this language

6 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.hacklinguistprimary71.3K files
.phppygmentsprimary417.7M files
.hhlinguistsecondary3.9M files
.hhilinguistsecondary5.3K files
.incpygmentssecondary6.3M files
.phplinguistsecondary417.7M files

Related languages

Hackett (0.25)HashLink (0.14)KPHP (0.14)Hare (0.13)Haxl (0.13)

LLM-contributed programs

Simple REST API endpoint in Hack

Provenance: commit 1b8908402c · authored 2025-10-22T11:54:13+02:00 · model anthropic/claude-3.5-sonnet · Temp 0.4
code.hack · license: MIT · added: 2025-10-22T09:54:13Z
<?hh

namespace HelloHackWorld\Controllers;

class BaseController {
  public static function getResponse(): array<string, mixed> {
    return array(
      'success' => true,
      'data' => array(
        'message' => 'Welcome to Hack!',
        'timestamp' => time(),
      ),
    );
  }

  public static function sendResponse(): void {
    $response = static::getResponse();
    header('Content-Type: application/json');
    print json_encode($response);
  }
}

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.php/0.phppredicates[{"kind": "any", "regexes": ["<\\?hh"]}]
h/linguist/.hh/0.hhpredicates[{"kind": "any", "regexes": ["<\\?hh"]}]

Contribute — propose a file extension

Tell us where to find evidence about Hack (mapped to pl/hack). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Hack/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← hac Hack VM →