prepare($sql)); } } class mysqli_stmt { private PDOStatement $stmt; private array $vars = []; private bool $executed = false; public function __construct(PDOStatement $stmt) { $this->stmt = $stmt; } public function bind_param(string $types, mixed &...$vars): bool { if (strlen($types) !== count($vars)) { throw new ArgumentCountError('The number of elements in the type definition string must match the number of bind variables'); } if (preg_match('/[^isdb]/', $types)) { throw new ValueError('Unknown bind type in "' . $types . '"'); } $this->vars = $vars; return true; } public function execute(): bool { $this->executed = $this->stmt->execute($this->vars); return $this->executed; } public function get_result(): mysqli_result { return new mysqli_result($this->stmt->fetchAll(PDO::FETCH_ASSOC)); } public function close(): bool { return true; } } class mysqli_result { private array $rows; public function __construct(array $rows) { $this->rows = $rows; } public function fetch_all(int $mode = MYSQLI_ASSOC): array { return $this->rows; } }