PHPackages                             garak/pokerino - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. garak/pokerino

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

garak/pokerino
==============

A PHP library to manage Poker card games

v0.3.0(2mo ago)01LGPL-3.0-or-laterPHPPHP ^8.2CI passing

Since Apr 3Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/garak/pokerino)[ Packagist](https://packagist.org/packages/garak/pokerino)[ RSS](/packages/garak-pokerino/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (3)Dependencies (10)Versions (6)Used By (0)

Pokerino: a PHP poker library
=============================

[](#pokerino-a-php-poker-library)

[![License](https://camo.githubusercontent.com/40477fa9c02591d3cfc4102bcc9953785424fe06f9dab589cef483df3e47399f/687474703a2f2f706f7365722e707567782e6f72672f676172616b2f706f6b6572696e6f2f6c6963656e7365)](https://packagist.org/packages/garak/pokerino)[![PHP Version Require](https://camo.githubusercontent.com/a213783f7a2b8e365a1fc2c569b5dd5cb9857871401e55dee6fccb0ea878dc06/687474703a2f2f706f7365722e707567782e6f72672f676172616b2f706f6b6572696e6f2f726571756972652f706870)](https://packagist.org/packages/garak/pokerino)[![Maintainability](https://camo.githubusercontent.com/87c43c33c0931767a15c42985c8aabc41ddac33e37751a0b216daa9fbe83c990/68747470733a2f2f716c74792e73682f67682f676172616b2f70726f6a656374732f706f6b6572696e6f2f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/garak/projects/pokerino)[![Code Coverage](https://camo.githubusercontent.com/0cdd049cece7996048c3e770a1022502797e8bd3a0b31fc402e65fbf5ed98440/68747470733a2f2f716c74792e73682f67682f676172616b2f70726f6a656374732f706f6b6572696e6f2f636f7665726167652e737667)](https://qlty.sh/gh/garak/projects/pokerino)

Introduction
------------

[](#introduction)

This library offers PHP classes for building a Poker card game:

- `Game` *(abstract, needs to be extended)*
- `Player` *(abstract, needs to be extended)*
- `Hand` — evaluates a poker hand
- `PokerRank` — identifies the best hand from a set of cards

`Hand` and `PokerRank` work with any number of cards and are not tied to a specific poker variant. `Game::deal()` is configurable for different dealing styles (see Usage). `Game::winner()` assumes a community-card structure (e.g. Texas Hold'em, Omaha) and should be overridden for variants without community cards (e.g. 5-Card Draw, 7-Card Stud).

### Supported hand rankings (highest to lowest)

[](#supported-hand-rankings-highest-to-lowest)

RankName1Royal Flush2Straight Flush3Four of a Kind4Full House5Flush6Straight7Three of a Kind8Two Pair9Pair10High CardInstallation
------------

[](#installation)

Run `composer require garak/pokerino`.

Usage
-----

[](#usage)

### Texas Hold'em example

[](#texas-holdem-example)

```
