PHPackages                             sixteenstudio/poker - 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. sixteenstudio/poker

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

sixteenstudio/poker
===================

A PHP-based poker libary, with hand strength calculations, texas holdem game logic and more.

0.1.1(11y ago)3564718[1 issues](https://github.com/sixteenstudio/poker/issues)BSD-3-ClausePHPPHP &gt;=5.3.0

Since Jan 19Pushed 11y ago4 watchersCompare

[ Source](https://github.com/sixteenstudio/poker)[ Packagist](https://packagist.org/packages/sixteenstudio/poker)[ RSS](/packages/sixteenstudio-poker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Poker
=====

[](#poker)

A PHP-based Poker library capable of hand calculations, Texas Hold'em game logic and more

Cards and Decks
---------------

[](#cards-and-decks)

The poker library retains a fairly simplified class structure, providing you with a simple card class which can be swapped out for any card implementation that follows its interface, allowing you to implement your own suits and even your own description translations.

```
$cards = [
    new Card('Club', 1),
    new Card('Spade', 2),
    new Card('Club', 3),
    new Card('Heart', 4),
    new Card('Diamond', 5),
];

$deck = new Deck($cards);
```

A Deck is a collection of cards that provides shuffle, take card, card count functions and any other functions that might be necessary when building a poker game.

A standard 52 card deck can be instantiated using the static newStandardDeck method

```
$52CardDeck = Deck::newStandardDeck();
```

Hands and HandStrengths
-----------------------

[](#hands-and-handstrengths)

Hands are made from a particular number of cards, of which the limit depends on the type of game. The default Hand class sets a limit of **2 cards**, as this is the standard Texas Hold'em hand card count.

```
$hand = new Hand([$deck->takeCard(), $deck->takeCard()]);
```

If an invalid hand is made (i.e. more than 2 cards are added to the hand), an **Sixteenstudio\\Poker\\InvalidHandException** will be thrown.

A hand is not to be confused with a hand strength, which is where the strongest hand dependant on a player's hand and any community cards is calculated. This class is currently still under development.

HandStrength instances will be useful because they can calculate, using any provided playable cards, what the strongest hand is that can be made, using only a small amount of method calls.

It will also allow a comparison between other HandStrength classes, which allows a Game class to calculate who the winning player is in any given situation.

Game
----

[](#game)

The Game class, which is currently under development, is an abstract class which will provide a framework for card based games (that means not only Poker!) that can be re-used for any number of games.

It will hold player information, game states and essentially the backend gameplay logic required to run a game server.

An Laravel 4.2 based application built using Socketier, MongoDB and this Poker library will be available soon, which will be an example of how an online poker room solution can be achieved using PHP.

Example
-------

[](#example)

The environment application will be found in the sixteenstudio/poker-environment repository. This provides a vagrant-based environment built on Laravel 4.2 to fully test out the features of the poker library and the texas hold'em functionality.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

4125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c900fbb0718ad3f56b7eb19dd70ebe9588bb471b93494ae799ae2bcc4204d25?d=identicon)[sixteenstudio](/maintainers/sixteenstudio)

---

Top Contributors

[![sixteenstudio](https://avatars.githubusercontent.com/u/4678077?v=4)](https://github.com/sixteenstudio "sixteenstudio (30 commits)")[![johncongdon](https://avatars.githubusercontent.com/u/67472?v=4)](https://github.com/johncongdon "johncongdon (4 commits)")

---

Tags

phppoker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sixteenstudio-poker/health.svg)

```
[![Health](https://phpackages.com/badges/sixteenstudio-poker/health.svg)](https://phpackages.com/packages/sixteenstudio-poker)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[monicahq/laravel-cloudflare

Add Cloudflare ip addresses to trusted proxies for Laravel.

3372.7M4](/packages/monicahq-laravel-cloudflare)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[napp/xray-laravel

AWS X-Ray for Laravel applications.

61407.3k](/packages/napp-xray-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
