Skip to content

Instantly share code, notes, and snippets.

View azjezz's full-sized avatar
😶

Saif Eddin Gmati azjezz

😶
View GitHub Profile
@azjezz
azjezz / 0.php
Last active December 12, 2022 15:35
<?php
declare(strict_types=1);
namespace App;
enum ArticleStatus {
case Published;
case Draft;
case Archived;
<?php
declare(strict_types=1);
namespace App;
struct User {
string $identifier;
}
@azjezz
azjezz / main.php
Last active December 30, 2021 15:27
<?php
declare(strict_types=1);
use Psl\Async;
use Psl\IO;
require 'vendor/autoload.php';
function fetch(string $id): string {

uncached

This benchmark runs with cache disabled for all of Symfony, Fastroute, and HackRouting.

The (matcher/dispatcher/resolver) is being created in each iteration from scratch.

Ranking:

  1. FastRoute
  2. Symfony
  3. HackRouting
<?php
/**
* @context={}
*/
function foo(): void {}
/**
* @context={io}

Keybase proof

I hereby claim:

  • I am azjezz on github.
  • I am azjezz (https://keybase.io/azjezz) on keybase.
  • I have a public key ASBG6C6v-7GwW-PBxKqaBF601YuVYZV1TN41DucA7xNz1Qo

To claim this, I am signing this object:

@azjezz
azjezz / Logger.hack
Created May 22, 2020 20:13
Nuxed basic console logger implementation
namespace Nuxed\Console\Log;
use namespace HH\Lib\Str;
use namespace Nuxed\Console;
use namespace Nuxed\Console\Output;
use namespace Nuxed\Contract\Log;
final class Logger implements Log\ILogger {
public function __construct(private Output\IOutput $output) {}
@azjezz
azjezz / better-app.php
Last active December 11, 2019 22:46
Improve the performance of your PHP 7.4 application
<?php
declare(strict_types=1);
namespace BetterApplication;
use FFI;
use Closure;
abstract class AbstractZendWriter
@azjezz
azjezz / brainfuck.php
Last active November 15, 2019 10:55
Brainfuck Lexer and Interpreter written in PHP ( https://3v4l.org/9lEte )
<?php
declare(strict_types=1);
namespace AzJezz\BrainFuck;
use ArrayIterator;
use Iterator;
use RuntimeException;
@azjezz
azjezz / .hax.json
Last active November 8, 2019 23:40
Hax configuration
{
"name": "My Application",
"base-path": "app/",
"entry": "app/bin/application.hack",
"compression-algorithm": "gzip",
"signing-algorithm": "sha512",
"include": [
"app/src/*",
"app/vendor/*"
],