Mago

Mago 1.59.0

Mago is a toolchain for PHP that aims to provide a set of tools to help developers write better code.

  • By Carthage Software
  • Open Source
  • Updated Oct 25, 2026
Download for Windows

About Mago

Mago is a comprehensive toolchain for PHP that helps developers write better code. Inspired by the Rust ecosystem, Mago brings speed, reliability, and an exceptional developer experience to PHP projects of all sizes.

What's new in 1.59.0

Mago 1.59.0 fixes analyzer narrowing across boolean guards, nullsafe checks, and elseif branches, improves generic and callable inference, and updates the analyzer extension protocol to MANA 2.2.

> [!NOTE]
>
> ### Support Mago
>
> Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
>
> Sponsor Mago ❤️

🐛 Bug Fixes

Analyzer

  • Namespace constants:preserves global constant fallback in namespaced declarations. (#2594, 0e6c1d8)
  • Method assertions:keeps getter assertions from the right side of ||. (#2600, #2609, 777429f)
  • CLI argument guards:fixes $argc typing and negated count() bounds. (#2607, #2608, be88d13)
  • Template defaults:applies declared defaults when constructing generic objects. (#2603, #2606, 2066b18)
  • Stored booleans:keeps narrowing implied by boolean variables across && and ||. (#2601, 8d739b3)
  • Nullsafe membership:narrows receivers after strict in_array() checks against non-null values. (#2599, 56e4b49)
  • Collection intersections:honors narrower read types in intersected collection types. (#2612, 79c295f)
  • Callable signatures:preserves parameter and return types through Closure::fromCallable(). (#2611, #2614, 3ea5963)
  • PHPDoc generics:checks missing, excess, and out-of-bounds template arguments in docblocks. (#2616, 2ac5c5d)
  • Boolean branches:preserves true and false types across short-circuit expressions. (#2593, 9890d23)
  • Dynamic instanceof:keeps valid operand types when a dynamic class check fails. (#2592, #2595, 65530ba)
  • Strict equality:narrows both union-typed operands to their shared types. (#2559, 923c061)
  • Elseif branches:preserves all reachable types and branch facts after conditional chains. (#2619, 0a098f4)
  • Nullsafe comparisons:avoids false impossible-null reports when assigning comparison results. (#2591, b7273f4)
  • URL components:allows empty user, password, query, and fragment strings from parse_url(). (#2590, #2610, 16dd70b)

📖 Documentation

Extensions

  • Protocol compatibility:documents MANA 2.2 constant fallback and worker upgrade requirements. (#2594, 0e6c1d8)

🏗️ Internal

CI

  • Pull request limit:limits outside contributors to one open PR at a time, including drafts. (9b6979c)

Tooling

  • Justfile cleanup:removes an unused variable. (3f212f3)

🧩 Extension Protocol

Analyzer
…

Full release notes »

Technical details

PublisherCarthage Software
Version1.59.0
Release date2026-10-25
LicenseApache-2.0
Installer typezip
Architecturex64
Package IDCarthageSoftware.Mago

Links & install command

Install Mago from the command line with Windows Package Manager (winget):

winget install --id=CarthageSoftware.Mago -e

astdevformattinglintphpsemantic-checksstatic-analysis

Older versions

  • 1.58.2
  • 1.57.0
  • 1.56.3
  • 1.54.0
  • 1.50.0
  • 1.47.2
  • 1.46.0
  • 1.42.0
  • 1.40.2