Stars: 1070
Forks: 67
Pull Requests: 304
Issues: 102
Watchers: 22
Last Updated: 2023-09-05 07:31:48
📚 PHP Standard Library - a modern, consistent, centralized, well-typed, non-blocking set of APIs for PHP programmers
License: MIT License
Languages: PHP, Makefile
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.
<?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;
});
Supported installation method is via composer:
composer require azjezz/psl
Please refer to the php-standard-library/psalm-plugin
repository.
Please refer to the php-standard-library/phpstan-extension
repository.
You can read through the API documentation in docs/
directory.
Have a look at CONTRIBUTING.md
.
Thanks to our sponsors and supporters:
JetBrains |
---|
The MIT License (MIT). Please see LICENSE
for more information.