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
🌐
Slack
slack.engineering › hacklang-at-slack-a-better-php
Hacklang at Slack: A Better PHP | Engineering at Slack
April 14, 2020 - Hack’s type system has one feature in particular, Shapes, that caught on like wildfire at Slack, and I believe it’s the reason we never looked back once we introduced Hack to our codebase. PHP’s array type, bewilderingly, can act as both a list (an ordered set of values) and a map (a set of key value pairs) at the same time. Most programming languages use separate types for these. In my experience, this is an endless source of bugs in PHP code, especially as functions like array_merge ...
🌐
TikTok
tiktok.com › discover › how-to-combine-shapes-in-canva
How to Combine Shapes in Canva | TikTok
3 weeks ago - 🤯 Go to Apps → search “Combo” Pick ANY shape → combine, union, subtract, intersect or exclude ✨ Create custom shapes exactly how YOU want — no limits! 🔥 This is a game-changer for designers who want clean, unique layouts fast.
🌐
TikTok
tiktok.com › discover › how-to-merge-shapes-in-canva
How to Merge Shapes in Canva | TikTok
6 days ago - 🤯 Go to Apps → search “Combo” Pick ANY shape → combine, union, subtract, intersect or exclude ✨ Create custom shapes exactly how YOU want — no limits! 🔥 This is a game-changer for designers who want clean, unique layouts fast.
🌐
YouTube
youtube.com › watch
Merge Shapes in Illustrator | Shape Builder, Pathfinder, & Grouping Techniques to Combine Shapes - YouTube
👉 Get a 7-Day Free Trial of Adobe Illustrator → https://adobe.prf.hn/click/camref:1101lKN6KUnlock the full potential of Adobe Illustrator by learning how to...
Published   September 8, 2024
🌐
Hhvm
docs.hhvm.com › hack › reference › class › HH.Shapes
HH\Shapes - HHVM and Hack Documentation
Hack · HHVM · See Something Wrong? 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 ·
Find elsewhere
🌐
Authentic Jobs
authenticjobs.com › home › career development › 11 adobe illustrator hacks every design pro should know
11 Adobe Illustrator Hacks Every Design Pro Should Know
February 13, 2023 - Pathfinder is a powerful tool that allows you to combine and manipulate paths to create complex shapes with total accuracy. To use Pathfinder, select the objects you want to manipulate then go to Window > Pathfinder. Here, you’ll find some awesome options such as Merge, Minus Front, and Divide that allow you to combine paths in ways you wouldn’t be able to do without it.
🌐
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.
🌐
Flylib
flylib.com › books › en › 4.68.1.119 › 1
Creating a ShapeMerge Object | 3ds Max 9 Bible
Figure 18.5: Use the Parameters rollout for the ShapeMerge compound object to cut or merge a shape
🌐
YouTube
youtube.com › nilaus
How To Merge CRYSTALS Without Breaking Them | 15 | Shapez 2 | Lets Play / Tutorial - YouTube
Shapez 2:Dive into a factory-building game where the focus is on just that — building huge factories! Construct sprawling multi-level factories and min-max y...
Published   August 29, 2024
Views   18K
🌐
Shapemerge
shapemerge.com
ShapeMerge
The most relaxing game ever
🌐
Coolmath Games
coolmathgames.com › 0-shape-merge
Play Shape Merge: From circle to star | Coolmath Games
Click and drag to place a shape into the grid. Right Click to rotate it. Place three of the same shape next to each other to merge them together!
🌐
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....
🌐
PyPI
pypi.org › project › shape-merge
shape-merge · PyPI
from shape_merge.merge import ShapeMerge shape_merge = ShapeMerge() shape_merge.populate_index_by_geojson(r"path_to_geo_json.geojson")
      » pip install shape-merge
    
Published   Oct 07, 2022
Version   1.0.3
🌐
Poki
poki.com › en › g › merge-shapes
MERGE SHAPES - Play Online for Free! | Poki
Use the Hammer to destroy some blocks, or apply the Double Rainbow to get a piece that will combine with any dot. If you're stuck, you can also use the shuffle function for a second chance.
🌐
Adobe
helpx.adobe.com › illustrator › web › add-and-edit-artwork › create-shapes › combine-shapes.html
Combine shapes in Illustrator on the web (Beta) | Illustrator
February 25, 2026 - Shape builder (Shift + M): Provides a fast and intuitive way to combine, merge, and divide multiple shapes using scribble and drag.
🌐
TikTok
tiktok.com › discover › how-to-do-merge-shapes-on-google-slides
How to Do Merge Shapes on Google Slides | TikTok
February 16, 2026 - Here’s how you can neatly arrange the shapes or images so they don’t take up your entire slide. #t#teachertokt#teachertipt#teacherhackg#googleslidese#edtecht#techtipt#teachertechtipt#tiktokteachert#teacher ... How to duplicate objects on slides #InteriorDesign #HeinzHalloween #teachersoftiktok #teachertechtips #techtipsforteachers #googletricks ... this is my favorite hack.