xp-lang / xp-static
XP static initializer blocks
Installs: 1 067
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.4.0
- xp-framework/compiler: ^9.0 | ^8.0
- xp-framework/core: ^12.0 | ^11.0 | ^10.0
Requires (Dev)
- xp-framework/test: ^2.0 | ^1.0
README
Plugin for the XP Compiler which adds a static initializer syntax for PHP. This is compiled to __static()
functions recognized by the XP class loading mechanism.
Example
namespace com\example\brotli; class Streams { static { stream_wrapper_register('brotli', self::class); } // ... }
Installation
After installing the XP Compiler into your project, also include this plugin.
$ composer require xp-framework/compiler # ... $ composer require xp-lang/xp-static # ...
No further action is required.