Psl - PHP标准库

PHP 标准库--为 PHP 程序员提供的一套现代、一致、集中、类型完善的应用程序接口。「PHP Standard Library - a modern, consistent, centralized, well-typed set of APIs for PHP programmers.」

Github星跟蹤圖

[!IMPORTANT]

🇵🇸 Support Palestine 🇵🇸

In light of recent events in Gaza, I encourage everyone to educate themselves on the ongoing issues in Palestine and consider supporting the people there. Here are some resources and donation links:

Thank you for taking a moment to bring awareness and make a difference. 🇵🇸❤️

Psl - PHP Standard Library

Unit tests status
Static analysis status
Security analysis status
Coding standards status
Coding standards status
CII Best Practices
Coverage Status
MSI
Type Coverage
Total Downloads
Latest Stable Version
License

Psl is a standard library for PHP, inspired by hhvm/hsl.

The goal of Psl is to provide a consistent, centralized, well-typed set of APIs for PHP programmers.

Example

<?php

declare(strict_types=1);

use Psl\Async;
use Psl\TCP;
use Psl\IO;
use Psl\Shell;
use Psl\Str;

Async\main(static function(): int {
    IO\write_line('Hello, World!');

    [$version, $connection] = Async\concurrently([
        static fn() => Shell\execute('php', ['-v']),
        static fn() => TCP\connect('localhost', 1337),
    ]);

    $messages = Str\split($version, "\n");
    foreach($messages as $message) {
        $connection->writeAll($message);
    }

    $connection->close();

    return 0;
});

Installation

Supported installation method is via composer:

composer require azjezz/psl

Psalm Integration

Please refer to the php-standard-library/psalm-plugin repository.

PHPStan Integration

Please refer to the php-standard-library/phpstan-extension repository.

Documentation

You can read through the API documentation in docs/ directory.

Interested in contributing?

Have a look at CONTRIBUTING.md.

License

The MIT License (MIT). Please see LICENSE for more information.

主要指標

概覽
名稱與所有者azjezz/psl
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2019-12-24 01:19:10
推送於2025-05-15 05:37:18
最后一次提交
發布數53
最新版本名稱3.3.0 (發布於 2025-05-15 07:37:04)
第一版名稱0.1.0 (發布於 )
用户参与
星數1.3k
關注者數21
派生數76
提交數727
已啟用問題?
問題數118
打開的問題數25
拉請求數358
打開的拉請求數4
關閉的拉請求數29
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?