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.
- FastRoute
- Symfony
- HackRouting
| <?php | |
| /** | |
| * @context={} | |
| */ | |
| function foo(): void {} | |
| /** | |
| * @context={io} |
| <?php | |
| declare(strict_types=1); | |
| use Psl\Async; | |
| use Psl\IO; | |
| require 'vendor/autoload.php'; | |
| function fetch(string $id): string { |
| <?php | |
| declare(strict_types=1); | |
| namespace App; | |
| struct User { | |
| string $identifier; | |
| } |
| <?php | |
| declare(strict_types=1); | |
| namespace App; | |
| enum ArticleStatus { | |
| case Published; | |
| case Draft; | |
| case Archived; |
| fennec check | |
| error: argument 2 of function 'Qux\foo' expected `int`, but `non-empty-list { 12 }` was found | |
| ┌─ main.php:9:14 | |
| │ | |
| 9 │ foo("hello", [12], 1.0); | |
| │ ^^^^ argument 2 has type `non-empty-list { 12 }` | |
| │ | |
| ┌─ foo.php:7:27 | |
| │ | |
| 7 │ function foo(string $bar, int $baz, bool $f): void |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| REPO="carthage-software/mago" | |
| BIN_NAME="mago" | |
| TMP_DIR=$(mktemp -d) | |
| NEW_ISSUE="https://github.com/carthage-software/mago/issues/new" | |
| INSTALL_DIR="" |
| /// Increments an alphanumeric string. | |
| /// | |
| /// Rust implementation based on PHP's str_increment function from php-src: | |
| /// https://github.com/php/php-src/blob/1de16c7f15f3f927bf7e7c26b3a6b1bd5803b1cc/ext/standard/string.c#L1227 | |
| /// | |
| /// # Arguments | |
| /// | |
| /// * `input` - The string to increment | |
| /// |
| <?php | |
| interface Hash { | |
| public function hash(Hasher $hasher): int; | |
| } | |
| interface ConcurrentHashMap<K: Hash, V> { | |
| // ... | |
| public function flatten<S>(): ConcurrentHashMap<K, S> |