{"id":20941090,"url":"https://github.com/xp-lang/xp-static","last_synced_at":"2026-02-01T22:32:35.386Z","repository":{"id":57084858,"uuid":"439873535","full_name":"xp-lang/xp-static","owner":"xp-lang","description":"XP static initializer blocks","archived":false,"fork":false,"pushed_at":"2024-09-01T08:03:00.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T18:07:57.486Z","etag":null,"topics":["initializer","php7","php8","xp-compiler"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-lang.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-19T13:40:46.000Z","updated_at":"2024-09-01T08:03:03.000Z","dependencies_parsed_at":"2024-03-28T21:38:27.245Z","dependency_job_id":"ba5119fa-868a-4a07-95a1-e6cc1d3914ba","html_url":"https://github.com/xp-lang/xp-static","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"6cedf3367f1d5800ed6ea1beeb3cfcb102ff50a9"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/xp-lang/xp-static","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fxp-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fxp-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fxp-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fxp-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-lang","download_url":"https://codeload.github.com/xp-lang/xp-static/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fxp-static/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28993253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["initializer","php7","php8","xp-compiler"],"created_at":"2024-11-18T23:12:59.227Z","updated_at":"2026-02-01T22:32:35.370Z","avatar_url":"https://github.com/xp-lang.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"XP static initializer blocks\n============================\n\n[![Build status on GitHub](https://github.com/xp-lang/xp-static/workflows/Tests/badge.svg)](https://github.com/xp-lang/xp-static/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-lang/xp-static/version.svg)](https://packagist.org/packages/xp-lang/xp-static)\n\nPlugin for the [XP Compiler](https://github.com/xp-framework/compiler/) which adds a static initializer syntax for PHP. This is compiled to `__static()` functions recognized by the XP class loading mechanism.\n\nExample\n-------\n\n```php\nnamespace com\\example\\brotli;\n\nclass Streams {\n  static {\n    stream_wrapper_register('brotli', self::class);\n  }\n\n  // ...\n}\n```\n\nInstallation\n------------\nAfter installing the XP Compiler into your project, also include this plugin.\n\n```bash\n$ composer require xp-framework/compiler\n# ...\n\n$ composer require xp-lang/xp-static\n# ...\n```\n\nNo further action is required.\n\nSee also\n--------\n* [PHP RFC: Static Constructors](https://wiki.php.net/rfc/static_constructor) - 2024\n* [PHP RFC: Static Class Constructor](https://wiki.php.net/rfc/static_class_constructor) - 2015\n* [Class static initialization block @ PHP Internals (2021)](https://externals.io/message/116031)\n* [Class static initialization blocks @ V8.dev](https://v8.dev/features/class-static-initializer-blocks)\n* [Static constructor @ PHP Internals (2015)](https://externals.io/message/84602)\n* [Static Constructors (C# Programming Guide)](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-constructors)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-lang%2Fxp-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-lang%2Fxp-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-lang%2Fxp-static/lists"}