Skip to content

xp-lang/xp-static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XP static initializer blocks

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.4+ Supports PHP 8.0+ Latest Stable Version

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.

See also

About

XP static initializer blocks

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages