Actually executing Hack code doesn't necessarily typecheck everything. You need to actually run a separate tool to enforce the type system, as described in the docs article linked here. When you do that, you'll get an error that looks something like this, depending on the exact version of HHVM you have:

File "shapes.php", line 10, characters 19-23:
Invalid argument (Typing[4110])
File "shapes.php", line 3, characters 41-43:
This is an int
File "shapes.php", line 10, characters 42-76:
It is incompatible with a string

Modern versions of HHVM will also yell at you if you aren't running the typechecker; I suspect you're running an older version, before we realized this was a point of confusion -- sorry!

What actually happens when you run type-incorrect code is undefined behavior. The answer by Ed Cottrell is correct for the current version of HHVM -- we do the same thing PHP does to coerce types -- but keep in mind it's undefined behavior and may change in future versions without notice.

Answer from Josh Watzman on Stack Overflow
🌐
Hhvm
docs.hhvm.com › shape
Shape | Hack & HHVM Documentation
A shape is created with the shape keyword, with a series of field names and values.
Discussions

'Hack' or library or tool that lets you create shapes that you can copy on the rM2
This is what I use - a batch script for drawj2d.Once you get it set up, drag & drop your image onto the script file & it will automatically upload to your rM2. https://www.reddit.com/r/RemarkableTablet/comments/15trvjp/adding_png_to_a_pdf/ More on reddit.com
🌐 r/RemarkableTablet
8
6
February 5, 2024
hacklang - How to access optional shape field in hack? - Stack Overflow
To give an example, let's assume I have a type foo of the following shape, type foo = shape( ?'bar' => float, ... ); Now if I try to access value of field bar in the following way, More on stackoverflow.com
🌐 stackoverflow.com
How to instantiate a shape type object in hacklang - Stack Overflow
type ThisIsMyShapeType = shape( 'some_prop' => bool, ); ... In Hack, shapes use structural typing so you don't need to declare your variable is a ThisIsMyShapeType -- the typechecker will verify that $x has all of the right fields to match the type. More on stackoverflow.com
🌐 stackoverflow.com
is there a hack to make perfect lines and triangles etc.
In upcoming 3.8 update, they add a functuon to draw a perfect line by holding the pen for 1 second. More on reddit.com
🌐 r/RemarkableTablet
10
2
October 22, 2023
🌐
Hhvm
docs.hhvm.com › hack › reference › class › HH.Shapes
HH\Shapes - HHVM and Hack Documentation
File an Issue · DocumentationHackReferenceClassHH\Shapes · namespace HH; abstract final class Shapes {...} ::at(shape() $shape, arraykey $index) Returns the value of the field $index of $shape, throws if the field is missing ·
🌐
Reddit
reddit.com › r/remarkabletablet › 'hack' or library or tool that lets you create shapes that you can copy on the rm2
r/RemarkableTablet on Reddit: 'Hack' or library or tool that lets you create shapes that you can copy on the rM2
February 5, 2024 -

I distinctly recall seeing something like that but couldn't find it again when I searched: I want to make things like check boxes, check marks and other little symbols that I can copy and paste in my documents. If you manually make a PNG or PDF, those things are not copyable, but there was a tool that would let you make documents with shapes that you could copy, just as if you'd written/drawn them yourself. Anyone got a name or link for me ?

🌐
Hhvm
docs.hhvm.com › hack › reference › class › HH.Shapes › idx
HH\Shapes::idx
File an Issue · DocumentationHackReferenceClassHH\Shapesidx · Use Shapes::idx to retrieve a field value in a shape, when the key may or may not exist · public static function idx( shape(...) $shape, arraykey $index, mixed $default = NULL, ...
🌐
Learn X in Y Minutes
learnxinyminutes.com › docs › hack
Learn Hack in Y Minutes
*/ /* ========================... float $hello_world = "Hello World!"; // string $null_string = null; // null // Create a `shape` with the shape keyword, with a series of field names and values....
Find elsewhere
🌐
Slack
slack.engineering › hacklang-at-slack-a-better-php
Hacklang at Slack: A Better PHP | Engineering at Slack
April 14, 2020 - Hack improves upon this by separating these into different types and using generics to describe the types of their keys and values. A list-like array containing strings is a vec<string>, and a map-like array with string keys and integer values is a dict<string, int>. dict<string, mixed> is a valid, but not particularly useful type annotation, which says the dict contains string keys and values of any type. Enter shapes.
🌐
GitHub
github.com › facebook › hhvm › issues › 7130
Hack: Allow extending shapes · Issue #7130 · facebook/hhvm
<?hh // strict type AOptions = shape( 'a' => int, 'b' => ?string, ); type BOptions = shape( 'a' => int, 'b' => ?string, 'c' => (function():void), ); class A { public function __construct(protected AOptions $options) {} } class B extends A { protected (function():void) $c; public function __construct(BOptions $options) { $this->c = $options['c']; parent::__construct($options); } }
Author   facebook
🌐
YouTube
youtube.com › watch
Create your own Shape with this Hack! | Google Slides! (Polyline) - YouTube
In this video, learn how to create your own shape in Google Slides!✅Subscribe to my channel for more Google Slides tips & tricks: https://youtube.com/@SlideW...
Published   June 17, 2025
🌐
Blogger
hhvmhack.blogspot.com › 2014 › 03 › shapes.html
HHVM and HACK Programming language: Shapes
In fact, most PHP files are already valid Hack files. We made a conscious choice not to support a handful of deprecated functions and features that were incompatible with static typing (e.g. “variable variables” and the extract() function). We have also added many new features that we believe will help make developers more productive. ... <?hh function why_shapes(array $arr_as_struct): array { if ($arr_as_struct['id'] === '573065673A34Z') { $arr_as_struct['count']++; } else { $arr_as_struct['url'] = "http://google.com"; $arr_as_struct['count']--; } return $arr_as_struct; } function main_why_shapes() { $my_struct = array('id' => null, 'url' => null, 'count' => 0); $my_struct['id'] = '573065673A34Y'; $my_struct['url'] = 'http://facebook.com'; var_dump($my_struct); $my_struct = why_shapes($my_struct); var_dump($my_struct); } main_why_shapes();
🌐
YouTube
youtube.com › watch
STOP Guessing Sweep Shapes - Use THIS HACK! - YouTube
Finally develop mastery over sweep picking and the entire fretboard:https://patreon.com/shredmentorGet the FREE "Sweep With Everything Ever" Pack:https://shr...
Published   March 15, 2025
🌐
YouTube
youtube.com › 7 minute ae tutorials
Shape Layer REPEATER HACK in After Effects | Adobe After Effects Quick Tip - YouTube
In this After Effects Quick Tip, you’ll learn how to create a circle of shapes that’s responsive, easy to use and remember, and is super versatile - all in l...
Published   October 5, 2023
Views   9K
🌐
HackMotion
hackmotion.com › home › blog › golf shot shaping made easy: how to shape shots with simple tips & drills
Golf Shot Shaping Made Easy: Tips & Drills for Control
September 5, 2025 - This drill connects ball position and handle height with the wrist positions measured by HackMotion. ... Set Up for Fade: Ball forward, handle lower and back. Increases lead wrist extension. Set Up for Draw: Ball back, handle more forward and higher. Increases wrist flexion. Swing and Monitor: Hit both shapes with HackMotion to confirm wrist positions.
🌐
GitHub
github.com › ZoneLikeWonderland › HACK-Model
GitHub - ZoneLikeWonderland/HACK-Model · GitHub
HACK Model includes 55 expression blendshapes, which have the same definition from ICT-FaceKit. Current expression shapes adopt the naming convention of the Apple ARKit, but with "Left" and "Right" specified with "_L" and "_R".
Starred by 156 users
Forked by 15 users
Languages   Python 74.8% | Jupyter Notebook 25.2%