Important
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 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 PslAsync;
use PslTCP;
use PslIO;
use PslShell;
use PslStr;
Asyncmain(static function(): int {
IOwrite_line('Hello, World!');
[$version, $connection] = Asyncconcurrently([
static fn() => Shellexecute('php', ['-v']),
static fn() => TCPconnect('localhost', 1337),
]);
$messages = Strsplit($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
.
The MIT License (MIT). Please see LICENSE
for more information.