{"id":47404999,"url":"https://github.com/php-standard-library/php-standard-library","last_synced_at":"2026-04-01T16:50:12.124Z","repository":{"id":36740558,"uuid":"229847129","full_name":"php-standard-library/php-standard-library","owner":"php-standard-library","description":"PHP Standard Library","archived":false,"fork":false,"pushed_at":"2026-03-26T23:41:13.000Z","size":9495,"stargazers_count":1502,"open_issues_count":20,"forks_count":83,"subscribers_count":23,"default_branch":"next","last_synced_at":"2026-03-27T04:38:05.906Z","etag":null,"topics":["ansi","async","collection","data-structures","encoding","grapheme-cluster","html","io","json","math","multibyte-strings","non-blocking","password-hashing","php","pseudo-random","secure-random","shell","standard-library","terminal-ui","type-assertion"],"latest_commit_sha":null,"homepage":"https://php-standard-library.dev","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-standard-library.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["azjezz","veewee"]}},"created_at":"2019-12-24T01:19:10.000Z","updated_at":"2026-03-26T23:41:16.000Z","dependencies_parsed_at":"2023-02-14T17:15:49.606Z","dependency_job_id":"afe0fd9f-e149-4413-9a8d-5774f23f9cce","html_url":"https://github.com/php-standard-library/php-standard-library","commit_stats":{"total_commits":678,"total_committers":41,"mean_commits":"16.536585365853657","dds":0.5014749262536873,"last_synced_commit":"77af0413020b2cfad94471418c6503cc711816fe"},"previous_names":["php-standard-library/php-standard-library"],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/php-standard-library/php-standard-library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-standard-library%2Fphp-standard-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-standard-library%2Fphp-standard-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-standard-library%2Fphp-standard-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-standard-library%2Fphp-standard-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-standard-library","download_url":"https://codeload.github.com/php-standard-library/php-standard-library/tar.gz/refs/heads/next","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-standard-library%2Fphp-standard-library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31130811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-29T01:34:30.680Z","status":"online","status_checked_at":"2026-03-29T02:00:07.786Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ansi","async","collection","data-structures","encoding","grapheme-cluster","html","io","json","math","multibyte-strings","non-blocking","password-hashing","php","pseudo-random","secure-random","shell","standard-library","terminal-ui","type-assertion"],"created_at":"2026-03-20T17:00:27.608Z","updated_at":"2026-03-29T03:00:43.415Z","avatar_url":"https://github.com/php-standard-library.png","language":"PHP","readme":"\u003cp align=\"center\" style=\"width: 80%; margin: auto;\"\u003e\n  \u003cimg src=\"docs/resources/banner.png\" alt=\"PSL\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n# PSL - PHP Standard Library\n\n![Unit tests status](https://github.com/php-standard-library/php-standard-library/workflows/unit%20tests/badge.svg)\n![Static analysis status](https://github.com/php-standard-library/php-standard-library/workflows/static%20analysis/badge.svg)\n![Coding standards status](https://github.com/php-standard-library/php-standard-library/workflows/coding%20standards/badge.svg)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4228/badge)](https://bestpractices.coreinfrastructure.org/projects/4228)\n[![Coverage Status](https://coveralls.io/repos/github/php-standard-library/php-standard-library/badge.svg)](https://coveralls.io/github/php-standard-library/php-standard-library)\n[![MSI](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fphp-standard-library%2Fphp-standard-library%2Fnext)](https://dashboard.stryker-mutator.io/reports/github.com/php-standard-library/php-standard-library/next)\n[![Total Downloads](https://poser.pugx.org/php-standard-library/php-standard-library/d/total.svg)](https://packagist.org/packages/php-standard-library/php-standard-library)\n[![Latest Stable Version](https://poser.pugx.org/php-standard-library/php-standard-library/v/stable.svg)](https://packagist.org/packages/php-standard-library/php-standard-library)\n[![License](https://poser.pugx.org/php-standard-library/php-standard-library/license.svg)](https://packagist.org/packages/php-standard-library/php-standard-library)\n\nA standard library for PHP, inspired by [hhvm/hsl](https://github.com/hhvm/hsl). PSL provides a consistent, centralized, well-typed set of APIs covering async, collections, networking, I/O, cryptography, terminal UI, and more - replacing PHP functions and primitives with safer, async-ready alternatives that error predictably.\n\n**[Documentation](https://php-standard-library.dev)** · **[Sponsor](https://github.com/sponsors/azjezz)**\n\n## Installation\n\n```shell\ncomposer require php-standard-library/php-standard-library\n```\n\nRequires PHP 8.4+.\n\n## Quick Look\n\n### Type-safe data validation\n\nValidate and coerce untrusted data with composable type combinators - shapes, unions, optionals - all with zero reflection overhead.\n\n```php\nuse Psl\\Type;\n\n$userType = Type\\shape([\n    'name' =\u003e Type\\non_empty_string(),\n    'age'  =\u003e Type\\positive_int(),\n    'tags' =\u003e Type\\vec(Type\\string()),\n]);\n\n$user = $userType-\u003ecoerce($untrustedInput);\n// array{name: non-empty-string, age: positive-int, tags: list\u003cstring\u003e}\n```\n\n### Structured concurrency\n\nRun concurrent operations with a single function call. Structured concurrency built on fibers - no promises, no callbacks.\n\n```php\nuse Psl\\Async;\nuse Psl\\TCP;\nuse Psl\\IO;\n\nAsync\\main(static function(): int {\n    [$a, $b] = Async\\concurrently([\n        static fn() =\u003e TCP\\connect('api.example.com', 443),\n        static fn() =\u003e TCP\\connect('db.example.com', 5432),\n    ]);\n\n    IO\\write_error_line('Both connections ready');\n\n    return 0;\n});\n```\n\n### Functional collections\n\nMap, filter, sort, and reshape arrays with pure functions. Separate return types for lists and dicts - no more array key confusion.\n\n```php\nuse Psl\\Vec;\nuse Psl\\Dict;\nuse Psl\\Str;\n\n$names = ['alice', 'bob', 'charlie'];\n\nVec\\map($names, Str\\uppercase(...));\n// ['ALICE', 'BOB', 'CHARLIE']\n\nVec\\filter($names, fn($n) =\u003e Str\\length($n) \u003e 3);\n// ['alice', 'charlie']\n\nDict\\pull($names, Str\\uppercase(...), fn($n) =\u003e $n);\n// {alice: 'ALICE', bob: 'BOB', charlie: 'CHARLIE'}\n```\n\n### TCP server in 10 lines\n\nProduction-ready networking primitives. TCP, TLS, UDP, Unix sockets - all async, all composable.\n\n```php\nuse Psl\\Async;\nuse Psl\\TCP;\nuse Psl\\IO;\n\nAsync\\main(static function(): int {\n    $server = TCP\\listen('127.0.0.1', 8080);\n    IO\\write_error_line('Listening on :8080');\n\n    while (true) {\n        $conn = $server-\u003eaccept();\n        Async\\run(static function() use ($conn) {\n            $conn-\u003ewriteAll(\"Hello!\\n\");\n            $conn-\u003eclose();\n        })-\u003eignore();\n    }\n});\n```\n## Tooling\n\n| Tool | Description |\n|---|---|\n| [Mago](https://mago.carthage.software/tools/analyzer/configuration-reference#available-plugins) | Enhanced type inference for Mago |\n| [Psalm Plugin](https://github.com/php-standard-library/psalm-plugin) | Enhanced type inference for Psalm |\n| [PHPStan Extension](https://github.com/php-standard-library/phpstan-extension) | Enhanced type inference for PHPStan |\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## License\n\nMIT - see [LICENSE](./LICENSE).\n","funding_links":["https://github.com/sponsors/azjezz","https://github.com/sponsors/veewee"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-standard-library%2Fphp-standard-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-standard-library%2Fphp-standard-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-standard-library%2Fphp-standard-library/lists"}