Features
Partial Function Application (RFC)
Mago now fully supports PHP 8.6's Partial Function Application RFC, enabling first-class callable creation using placeholder syntax. You can use positional (?), named (name: ?), and variadic (...) placeholders to create closures from existing functions and methods, with full type inference and validation to ensure type safety across your partial applications.
PHP Version Support
- Added support for PHP 8.5, which was released just days ago
- Switched minimum supported PHP version from 7.4 to 8.0
Looking Ahead to PHP 8.6
This release demonstrates Mago's unique capability to stay ahead of the PHP ecosystem. While PHP 8.6 won't be released for another year and the Partial Function Application RFC hasn't even been merged into PHP yet, Mago already provides full support for this feature. By controlling our entire stack, from parser to analyzer, we can implement and validate upcoming PHP features much faster than traditional tools, giving developers early access to write future-proof code with confidence.
Linter
- New
no-redundant-yield-fromrule to identify unnecessaryyield fromexpressions that can be simplified
Bug Fixes
Analyzer
- Fixed incorrect parameter type mapping when using named placeholders that reorder parameters in partial function application
- Corrected false positives when real methods are documented with
@methodannotations in child classes for return type refinement - Fixed variable invalidation logic to properly invalidate descendant variables when passed by reference
- Resolved trait constant access issues when using
self,static, and$thiskeywords - Suppressed redundant unused statement issues in test contexts
- Disabled reporting of
#[Override]attribute issues before PHP 8.3 - Corrected impossible condition detection when comparing
numericandarray-keytypes - Eliminated invalid and redundant auto-fix suggestions
- Fixed
array_merge()result computation when using empty arrays as arguments
Codex
- Improved docblock inheritance logic to respect explicit return types in child classes instead of inheriting parent types
- Enhanced overall docblock inheritance handling with better resolution rules
Database
- Corrected path normalization for Windows systems during test execution
- Improved pattern specificity resolution for path and include conflicts
- Fixed file logical name usage when updating files during watch mode
Linter
- Prevented false positives in
no-redundant-mathrule for float division operations - Disabled
sensitive-parameterrule for PHP versions below 8.2 - Fixed incorrect static closure suggestions when nested closures reference
$this
Formatter
- Preserved parentheses around constant access expressions in
instanceofbinary operations
Docblock
- Added support for multiple spaces after colons in callable type annotations
Collector
- Disabled reporting of unfulfilled expectations during incremental analysis to reduce noise
Installation
- Fixed installation script incorrectly exiting successfully when the download server is unavailable
Improvements
Syntax
- Tagged
Expression,Statement, andNodeenums as#[non_exhaustive]for future compatibility
Full Changelog: 1.0.0-rc.3...1.0.0-rc.4