Skip to content
This repository was archived by the owner on May 23, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

33 Commits

Repository files navigation

Compact methods for PHP

Build status on GitHubXP Framework ModuleBSD LicenceRequires PHP 7.4+Supports PHP 8.0+Latest Stable Version

Plugin for the XP Compiler which adds compact methods to the PHP language.

Example

Compact methods use the fn keyword, much like PHP 7.4 arrow functions. The RFC suggests this in its Future Scope section.

class Person {
private$name;
publicfn name(): string => $this->name;
}

Installation

After installing the XP Compiler into your project, also include this plugin.

$ composer require xp-framework/compiler
# ...
$ composer require xp-lang/php-compact-methods
# ...

No further action is required.

See also

Releases

Packages

Used by

Contributors

Languages