NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1012 most downloaded on Packagist
Mago is a toolchain for PHP that aims to provide a set of tools to help developers write better code.
Latest stable
1.60.2
Last release 6 days ago
16 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
199 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
Mago 1.60.2 stops reporting the failure results of PCRE calls with literal patterns, and fixes 22 bugs in the analyzer, type system, stubs, semantics
Mago 1.60.2 stops reporting the failure results of PCRE calls with literal patterns, and fixes 22 bugs in the analyzer, type system, stubs, semantics checks, and Twig formatter.
null or false failure result of preg_* calls with literal patterns. (#2723, 0aa1f13)int and float, when narrowing == and !=. (#2716, #2730, 82ce437)is_subclass_of(): narrows a class-string checked against an unrelated interface to an intersection, not never. (#2724, 38eaee5)is_array() on iterables: keeps class-string keys when narrowing an iterable to an array. (a68b39b)Psl\Iter\contains(): narrows like strict in_array(), so false only rules out values the haystack surely holds. (#2728, c58dd15)reference-reused-from-confusing-scope in nested foreach loops by reference. (#2726, e97e902)null keys into '' in nested writes, as PHP does. (#2720, 48644ac)of variable in null array index messages. (0332a90)get_class($object):: and $object::class:: like $object::, so interfaces no longer warn. (#2725, bce958d)getCode() from the $code property of the exception and its subclasses. (3cca74e)(int) and (float) casts of SimpleXMLElement and GMP. (#2721, c46fc88)never: keeps never when reading a property of a never value. (8246d77)APP_DEBUG in $_ENV and $_SERVER as a string, so proc_open() accepts $_ENV. (#2715, f9de5b2)@return, keeping its scalars. (#2727, 21b4e54)class_alias() call no longer makes types from classes in includes unknown. (#2722, e6350fd)ArrayIterator::class fits class-string<ArrayIterator<K, V>>. (14c3548)call_user_func() callbacks, stat() keys, nullable Iterator returns, and WeakReference variance. (969e149)__toString(): ?string. (#2713, #2714, 777d2b4)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.60.1...1.60.2
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Mago 1.60.1 fixes --staged formatting with git versions older than 2.38, and ships the x86_64 Linux (glibc) archive missing from 1.60.0.
Mago 1.60.1 fixes --staged formatting with git versions older than 2.38, and ships the x86_64 Linux (glibc) archive missing from 1.60.0.
No protocol changes in this release.
Full Changelog: 1.60.0...1.60.1
Mago 1.60.0 adds a Twig formatter and linter, new analyzer and linter checks, and more than 300 fixes across the analyzer, type system, formatter, and
Mago 1.60.0 adds a Twig formatter and linter, new analyzer and linter checks, and more than 300 fixes across the analyzer, type system, formatter, and stubs.
Thanks to monbillet.ch for sponsoring Mago's new Twig formatter and linter.
mago twig:fmt to format Twig tags and expressions without touching HTML. (#303, #2679, #2708, #2709, #2710, b7e6a70, 15f9c01, e67c79b, 6280e01)mago twig:lint with 25 rules, pragmas, baselines, and safe fixes. (#303, #2707, 993c741)See the Twig formatter and Twig linter documentation to get started.
check-throw-type-covariance setting for overrides and interface methods. (#2502, #2510, 2b1f018)(int) casts of arrays. (#2673, #2702, 47f52e0)%, |, and <<. (e44aa44)|| operands: reports || operands that earlier conditions already rule out. (6561819)new expressions whose result is unused and whose creation has no effect. (#2672, 2e7b523)prefer-null-coalescing-assignment: suggests ??= when the right side of ?? assigns to the left. (#2682, e6e10d1)no-unused-return-value: reports private methods whose return value every call discards. (#2671, d867966)mixed after elseif branches. (#2637, a4189a4)elseif and else assignments, and the negated condition of an if that exits. (234208d, a5b59c4)unset() made in a branch, and forgets offset narrowing when a branch redefines the array. (faa9e07, 49e3b1c)?? throw, and stops marking the result of ?? as possibly undefined. (0162594, 3dc7442)??, &&, and || operands as conditional. (a952925, c369384, 0349881)finally. (8105546, 4fb2695)switch (true) cases by earlier ones. (cef4032, 4a1bda3)if conditions already ruled out. (7d35d64, da3040c)?> tag when reporting code after exit. (497e2e1)do-while, after the loop. (2a29581, f3ceaf2, c4c2608)break on every pass, and ignores switch breaks. (86bd748, b19a1dc, 91504b6)while (true) from its breaks alone. (17fbb36, b6da088)|| whole. (4509d8c, 39e572a, 2abcc05)is_subclass_of(): excludes the class itself from the narrowed type. (#2650, #2651, 2a52dd8)!is_object(), and objects to Traversable on is_iterable(). (#2620, 59aa9a1, 641ee0f)(bool) casts, method_exists(), static::class, and count($a, COUNT_NORMAL). (99e17bb, 10894b7, f5b6d33)int on is_float(), keeps truthy mixed truthy, and skips ctype_* on known types. (aa868cd, 075061b, 0655a03)is_string(), is_array(), and is_object() checks. (b85cb35)nonnull mixed value as never null in comparisons and narrowing. (701ad13)int from a union when a comparison goes past the int range. (2941bbb)instanceof self, static, and $this, and checks literal class-string variables. (22c67ee, c49ab53)instanceof. (fb33795, 2a07e58)get_class() in match arms, and treats a final class's literal name like ::class. (cabaa1a, d1c6fdb)function_exists() for unavailable functions, and narrows literals by class_exists(). (8c4bdab, a18b3a1)isset() narrowing under an outer isset(). (#2701, 7abeb44)!isset(), and handles properties some members lack. (0e5582f, 0ae9272)isset(), and allows writes to properties that isset() proved. (7ef6481, ffc5172)null from template bounds on isset(), and checks bounds before reporting it impossible. (00a7edb, 2d588f1)@phpstan-assert !A|B. (#2640, 283b2a2)@psalm-assert results again on each call. (#2698, 4eb3b80)!empty(). (f01ce66, 69ac044, 9591a7c)null in conditions. (b78e19b)$$name as an assignment target. (1cbbac0)null, and writes back array items. (6b86ef1, 92dd4a7, 5795dbd, aef269d)$list[0]->prop ?? null. (#2641, #2658, 5185945)... in array literals. (86ab1d0, 58be287)array_is_list(). (b0ba014, 4e483eb)@ignore-nullable-return and @ignore-falsable-return in array keys. (e02f0ea)ArrayAccess: types reads by offsetGet(), and stops treating writes as proof that an offset is set. (e67fe7c, 0734cd9)array_column(): keys results by the cast index column, reads int keys, and reports object index columns. (8ee4ac7, 63c67c8, 7ddeb60)array_column() over enum cases by their name and value properties. (#2695, c69b112)array_map(): types results over several arrays as lists of the callback's inferred return. (2d96468, 4f65548)array_filter(): narrows by overlapping and union callback assertions, and resolves first-class callables. (2188abc, 9d03ca1)array_reduce(): keeps a typed accumulator's own carry type. (6b2ee5e)array_merge(), array_merge_recursive(), and array_replace(). (5918c3e, 7fc7e83)filter_var(): reads flags from an options array and types array results. (7203156)strlen(): infers exact lengths for unions of literal strings. (#2655, 76f28b2)non-falsy-string from two non-empty strings. (#2623, 54d0302)strval() and a lone interpolated value like a (string) cast. (49c57dd)strlen() or mb_strlen() against zero. (382fc5c, 72fcce5)implode(): infers non-empty results from the pieces and separator. (1956f2d)0.0, and types negative powers as float and ~ on numbers as int. (c2c380e, 5030df1, 7bc782a)% by floats that truncate to zero, and shifts by negative floats. (8daabb9)numeric where int, float, and string are all allowed. (3d9e2ec)instanceof, scalar checks, and non-empty checks. (aa93d36, b475d1e, 26e0579)is_a(). (647da0f)never, and on disjoint arrays and subjects. (e75ee9b, d57fbc0, 09eefad, 2137569)@param-out, @assert, @throws, @mixin, and @property. (b4ffbea, 023ded4)SplObjectStorage: gives new SplObjectStorage() open templates. (1f46001)static late-bound in final methods, and binds it through template receivers. (00b717f, 9202d68, 42b243d)$this when calling an ancestor method by name, and static in first-class method callables. (f175a10, Note truncated.
Mago 1.59.0 fixes analyzer narrowing across boolean guards, nullsafe checks, and elseif branches, improves generic and callable inference, and updates
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
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
||. (#2600, #2609, 777429f)$argc typing and negated count() bounds. (#2607, #2608, be88d13)&& and ||. (#2601, 8d739b3)in_array() checks against non-null values. (#2599, 56e4b49)Closure::fromCallable(). (#2611, #2614, 3ea5963)true and false types across short-circuit expressions. (#2593, 9890d23)parse_url(). (#2590, #2610, 16dd70b)Update the PHP SDK to 1.59.0 when upgrading Mago. Custom analyzer workers must use MANA 2.2; MANA 2.1 workers are not compatible. The linter protocol is unchanged.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.58.2...1.59.0
Mago 1.58.2 fixes parser recovery for unfinished static accesses, keeping class names and call arguments in the syntax tree while you type.
Mago 1.58.2 fixes parser recovery for unfinished static accesses, keeping class names and call arguments in the syntax tree while you type.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
Foo:: and Foo::$ in the syntax tree during editor recovery. (#2589, 431e823)Full Changelog: 1.58.1...1.58.2
Mago 1.58.1 fixes the PGO build failure affecting macOS and Linux x86_64 musl in 1.58.0 and adds CI checks for the full PGO build cycle.
Mago 1.58.1 fixes the PGO build failure affecting macOS and Linux x86_64 musl in 1.58.0 and adds CI checks for the full PGO build cycle.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
Thanks for your patience while we fixed the release builds.
Full Changelog: 1.58.0...1.58.1
Deprecated casts : shows the cast as written in the source.
Mago 1.58.0 adds opt-in dead-catch checks, a prefer-self rule, and extension throw-type providers, cuts analysis overhead, and fixes type narrowing and PHP formatting.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
ValueError for known-valid BackedEnum::from() arguments. (#2544, #2565, 5bcf444)self. (#2528, aba4df1)[linter.rules]. (#2530, f2b479c)@no-named-arguments tags. (#2514, a33b014)mixed-array-index for keys whose type is mixed. (#2522, 4b19550)?? fallbacks. (#2515, #2563, 83a0bfd, 891c463)?-> on method calls. (#2547, ba38156)Traversable after type checks. (#2550, dd17cfb)get_class() and gettype() switch cases. (#2558, eba91e1)in_array(). (#2573, #2574, d5ca2a6, c16337a)isset() and empty() guards. (#2575, #2585, 9671d89, f8f46a6)array-key. (#2545, c4d7f9a)new (self::MAP[$key])() and related forms. (#2587, 0c7c2b5)false from class_implements() results for object inputs. (#2513, f7af709)typeName constructor argument optional. (#2519, 245ee75)is_a() and is_subclass_of(). (#2549, bfe814f)Update the PHP SDK to 1.58.0 when upgrading Mago. Custom analyzer workers must use MANA 2.1; MANA 2.0 workers are not compatible. The linter protocol is unchanged.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.57.0...1.58.0
Deprecated members : reports access to deprecated properties and class constants. ( #2478 , 90fa5e5 )
Mago 1.57.0 adds opt-in BcMath/GMP arithmetic, applies PHPDoc flags from type patches, fixes analyzer and formatter bugs, and speeds up work across the toolchain.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
BcMath\Number and GMP via allow-operator-overloading. (#2486, #2487, 0fff359)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.56.3...1.57.0
Mago 1.56.3 fixes formatter stability with preserved line breaks and keeps return types from valid method targets in unions.
Mago 1.56.3 fixes formatter stability with preserved line breaks and keeps return types from valid method targets in unions.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.56.2...1.56.3
Mago 1.56.2 speeds up formatting and lowers its memory use, adds generic parent bindings in type patches, and fixes template resolution, closure defau
Mago 1.56.2 speeds up formatting and lowers its memory use, adds generic parent bindings in type patches, and fixes template resolution, closure defaults, array access, and Drupal formatting.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
offsetSet() value type. (#2473, 25af17d)array<array-key, mixed> for object-to-array casts. (#2472, cc7e8e4)??= closure assignments. (#2466, c3ead42)null defaults. (#2470, #2471, 53cecd0)echo, nested classes, and switch comments. (#2465, c923807)class-string for class-name helpers and keeps false for parent lookups. (#2468, 70bef87)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.56.1...1.56.2
Mago 1.56.1 fixes false positives in enum constant arrays and inherited template bounds.
Mago 1.56.1 fixes false positives in enum constant arrays and inherited template bounds.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
isset() guard. (#2461, #2462, 58f309a)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.56.0...1.56.1
Mago 1.56.0 continues the performance and memory work, strengthens incremental analysis, and fixes closure types, constant defaults, and formatter sta
Mago 1.56.0 continues the performance and memory work, strengthens incremental analysis, and fixes closure types, constant defaults, and formatter stability. It also adds Rust APIs for editor tools and updates the analyzer extension protocol to MANA 2.0.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
__toString() as Stringable. (#2450, 51befd3)&& operands and the following body. (#2454, e7707be)$this out of static closure scopes. (5af4c93)SimpleXMLElement and SimpleXMLIterator to be falsy. (#2452, 27b0d2a)new in property and nullsafe-property chains. (#2455, 779b8c5)Analyzer extensions now use MANA 2.0. Update the PHP SDK to 1.56.0; other SDKs must support callable parameter out-types. MANA 1.x is no longer accepted. MEXT remains at 1.0.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.55.0...1.56.0
Mago 1.55.0 continues the performance work across analysis, linting, type handling, and reporting. It adds custom Guard breach reasons and fixes gener
Mago 1.55.0 continues the performance work across analysis, linting, type handling, and reporting. It adds custom Guard breach reasons and fixes generic return types, argument counts, and formatter stability.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
instanceof. (#2440, dcce51f)@inheritDoc. (#2444, 766df9b)clone, exit, and die globally, avoiding false Guard dependencies. (#2442, #2443, 25ee509)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.54.0...1.55.0
Mago 1.54.0 continues the performance work across analysis, PHPDoc parsing, metadata, name handling, and project loading. It also adds configurable sl
Mago 1.54.0 continues the performance work across analysis, PHPDoc parsing, metadata, name handling, and project loading. It also adds configurable slow-file warnings and fixes integer-comparison narrowing.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
null and false correctly in integer comparisons. (#2434, #2437, a75379c)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.53.0...1.54.0
Mago 1.53.0 improves analysis performance, file loading, name handling, and reporting, and fixes formatting of yield , direct new calls, and nested lo
Mago 1.53.0 improves analysis performance, file loading, name handling, and reporting, and fixes formatting of yield, direct new calls, and nested logical groups.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
yield and yield from behavior in binary expressions. (#2432, d374fef)new calls: omits redundant parentheses on PHP 8.4+, while honoring formatter settings. (#2430, cb4356f)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.52.0...1.53.0
Mago 1.52.0 makes analysis faster from file loading through reporting, adds rdkafka stubs, and fixes constant visibility, nullsafe loop types, magic-m
Mago 1.52.0 makes analysis faster from file loading through reporting, adds rdkafka stubs, and fixes constant visibility, nullsafe loop types, magic-method names, and built-in signatures.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
??. (#2428, ab12076)'refresh_token' while still checking names. (#2028, #2420, 4a9913b)null, in Ds\Map::get() and remove(). (#2425, cbb33fe)No protocol changes in this release.
Thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.51.2...1.52.0
Mago 1.51.2 fixes macOS and FreeBSD release builds. There are no analyzer, linter, formatter, or guard changes.
Mago 1.51.2 fixes macOS and FreeBSD release builds. There are no analyzer, linter, formatter, or guard changes.
Note
Does your company use Mago? Please consider sponsoring its development so we can keep fixing bugs and shipping releases.
Sponsor Mago ❤️
libc to 0.2.189 to fix the missing NOTE_PCTRLMASK error in mio. (e1c4ab6)No protocol changes in this release.
Full Changelog: 1.51.1...1.51.2
Mago 1.51.1 fixes false positives in mixed-condition analysis, restores optional built-in arguments, and corrects PSR-12 declarations, parameter align
Mago 1.51.1 fixes false positives in mixed-condition analysis, restores optional built-in arguments, and corrects PSR-12 declarations, parameter alignment, and method-chain formatting.
Note
Does your company use Mago? Please consider sponsoring its development. We need funding to keep improving Mago, fixing bugs, and shipping releases.
Sponsor Mago ❤️
= in declare statements. (#2416, 6fcc28d)... and & attached to parameter names. (#2182, #2417, 0dea4da)array_find_key: infers null for empty arrays and keeps input key types otherwise. (#2389, df7b3c7)No protocol changes in this release.
Thank you to everyone who contributed code to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.51.0...1.51.1
Mago 1.51.0 adds Swoole stubs and improves type analysis, with fixes for static locals, loop types, boolean guards, lint suggestions, and formatting.
Mago 1.51.0 adds Swoole stubs and improves type analysis, with fixes for static locals, loop types, boolean guards, lint suggestions, and formatting.
Note
Does your company use Mago? Please consider sponsoring its development. We need funding to keep improving Mago, fixing bugs, and shipping releases.
Sponsor Mago ❤️
__invoke results marked #[NoDiscard] or @must-use. (#2400, f01b94e)finally blocks. (#2410, 71764f0)if and changes in one branch. (#2411, 0d0224d)list(). (#2407, #2408, a11d5e3, 5d804d7)hook_* names in *.api.php unchanged with Drupal integration. (#2390, #2391, 335d8a7)?> after method chains with a semicolon on its own line. (#2393, 17cc593)extends to the schema. (#2354, 8556e0e)str_increment: marks its return type as non-empty-string. (452721b)number or null, using the schema. (#2398, 7ceff94)No protocol changes in this release.
A huge thank you to everyone who contributed to this release:
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.50.0...1.51.0
Mago 1.50.0 adds mago fix to apply fixes across all four tools until no changes remain, alongside safer imports, better type analysis, and more flexib
Mago 1.50.0 adds mago fix to apply fixes across all four tools until no changes remain, alongside safer imports, better type analysis, and more flexible pragmas and guard patterns.
mago fix: runs guard, analyzer, linter, and formatter until fixes settle, with safety controls. (#2157, 7386092)is_callable() narrowing for calls, closure conversion, offsets, and loops. (#2385, 18482c2)Stringable property names and variable-variable reads. (659446c)
preg_replace: preserves array key types and marks the replacement count as non-negative. (#2384, d894be8)mago fix and pragma lists in English, French, and Chinese. (#2157, #2109, 7386092, 05f6818)mul_add for Kan defect scores and handles watch-mode exit codes. (044b765, 116abff)No protocol changes in this release.
This release contains no merged external pull requests.
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.49.0...1.50.0
One column per month.