https://github.com/php-any/origami
在访问 hello work 场景下,和 go http 标准库接近,2 万左右 qps 。

同时新增了更加便捷的查询
$db = open("mysql", "root:root@/temp");
$db->ping();
Database\registerDefaultConnection($db);
@Table("users")
class User {
public int $id;
@Column("name")
public string $userName;
public int $age;
public float $coin;
@Column("create_at")
public string $createAt;
}
$data = DB<User>();
echo "=== 基础查询 ===\n";
$user = $data->where("id = ?", 100)->first();
dump($user);
除了 array 数组外,还有增强数组
$list = new List<int>();
$list->add(1);
$list->add(2);
$list->add(3);
// 手动迭代
$list->rewind();
while ($list->valid()) {
echo "索引: " . $list->key() . ", 值: " . $list->current() . "\n";
$list->next();
}
KV 方式的泛型类
$map = new HashMap<string, int>();
$map->put("apple", 10);
$map->put("banana", 20);
$map->put("orange", 30);