PHPackages                             mjacobus/gof - 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. mjacobus/gof

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

mjacobus/gof
============

Game of Life

272PHP

Since Sep 28Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Game of Life - A PHP Implementation
-----------------------------------

[](#game-of-life---a-php-implementation)

After a very fun code retreat delivered by [Urs Reupke](https://github.com/UrsKR)at [Goodgame Studios](http://goodgamestudios.com) I decided that I wanted to finish that exercise.

That was the [Game of Life](http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) implementation

Code information:

[![Build Status](https://camo.githubusercontent.com/26b9c38254e2f75edbaae02ffded37e1f0bbba0d5282fd046763bb7503fe2d15/68747470733a2f2f7472617669732d63692e6f72672f6d6a61636f6275732f47616d654f664c6966655048502e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mjacobus/GameOfLifePHP)[![Coverage Status](https://camo.githubusercontent.com/7c14f0ed619a0f608b1cc2e497f3036295dcae5dd5dd56f283adde3dc1d23d73/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d6a61636f6275732f47616d654f664c6966655048502f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/mjacobus/GameOfLifePHP?branch=master)[![Code Climate](https://camo.githubusercontent.com/902d106513444b3a288d8dd5fc190e47eebeea5a0d8a1a22a37be8840553e055/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d6a61636f6275732f47616d654f664c6966655048502e706e67)](https://codeclimate.com/github/mjacobus/GameOfLifePHP)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/931633629b87c515e43ba9b2ba258e1fe0ef6fa2bd44146271742736853a7524/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6a61636f6275732f47616d654f664c6966655048502f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mjacobus/GameOfLifePHP/?branch=master)

Package information:

[![Latest Stable Version](https://camo.githubusercontent.com/a2d54b88c5cde333064984f3d8ebdebda7dec7756e49b4e3b31e602495de4855/68747470733a2f2f706f7365722e707567782e6f72672f6d6a61636f6275732f676f662f762f737461626c652e737667)](https://packagist.org/packages/mjacobus/gof)[![Total Downloads](https://camo.githubusercontent.com/49bddc20d9912a4dbaa5be59a53116cb1e3be7e22f9bc743009d3d32b1d455f1/68747470733a2f2f706f7365722e707567782e6f72672f6d6a61636f6275732f676f662f646f776e6c6f6164732e737667)](https://packagist.org/packages/mjacobus/gof)[![Latest Unstable Version](https://camo.githubusercontent.com/b1cd116c2ff9d443444dc0f0787bc14be5e8c2ef4ff98fc76c166f6e1af7bda1/68747470733a2f2f706f7365722e707567782e6f72672f6d6a61636f6275732f676f662f762f756e737461626c652e737667)](https://packagist.org/packages/mjacobus/gof)[![License](https://camo.githubusercontent.com/e77fa0fd97ec1e566c68ad92eeb0c2cdd9369ea5deffcd6621b0af62cc13e4f6/68747470733a2f2f706f7365722e707567782e6f72672f6d6a61636f6275732f676f662f6c6963656e73652e737667)](https://packagist.org/packages/mjacobus/gof)[![Dependency Status](https://camo.githubusercontent.com/f5171c02b5a83396e152add1ae343112cecef7fb57ff51d51ceb521e56319133/68747470733a2f2f67656d6e617369756d2e636f6d2f6d6a61636f6275732f47616d654f664c6966655048502e706e67)](https://gemnasium.com/mjacobus/GameOfLifePHP)

Rules
-----

[](#rules)

The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

1. Any live cell with fewer than two live neighbours dies, as if caused by under-population. (loneliness death)
2. Any live cell with two or three live neighbours lives on to the next generation. (Happy Community Wont Change)
3. Any live cell with more than three live neighbours dies, as if by overcrowding. (over population death)
4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. (ThreeLiveNeighboursRessurection)

The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed—births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a pure function of the preceding one). The rules continue to be applied repeatedly to create further generations.

Source: [Wikipedia](http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).

### Usage

[](#usage)

### Web

[](#web)

- Clone
- Composer install
- `cd examples/web && php -S localhost:8080`
- Go to

### CLI

[](#cli)

- run `php examples/cli/run.php`

### Installing

[](#installing)

#### Installing Via Composer

[](#installing-via-composer)

Append the lib to your requirements key in your composer.json.

```
{
    // composer.json
    // [..]
    require: {
        // append this line to your requirements
        "mjacobus/gof": "*"
    }
}
```

### Alternative install

[](#alternative-install)

- Learn [composer](https://getcomposer.org). You should not be looking for an alternative install. It is worth the time. Trust me ;-)
- Follow [this set of instructions](#installing-via-composer)

### Issues/Features proposals

[](#issuesfeatures-proposals)

[Here](https://github.com/mjacobus/GameOfLifePHP/issues) is the issue tracker.

Contributing
------------

[](#contributing)

Please refer to the [contribuiting guide](https://github.com/mjacobus/GameOfLifePHP/blob/master/CONTRIBUTING.md).

### Lincense

[](#lincense)

[MIT](MIT-LICENSE)

### Authors

[](#authors)

- [Marcelo Jacobus](https://github.com/mjacobus)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/226834?v=4)[Marcelo Jacobus](/maintainers/mjacobus)[@mjacobus](https://github.com/mjacobus)

---

Top Contributors

[![mjacobus](https://avatars.githubusercontent.com/u/226834?v=4)](https://github.com/mjacobus "mjacobus (52 commits)")[![mamuz](https://avatars.githubusercontent.com/u/4173317?v=4)](https://github.com/mamuz "mamuz (12 commits)")[![UrsKR](https://avatars.githubusercontent.com/u/998794?v=4)](https://github.com/UrsKR "UrsKR (1 commits)")

### Embed Badge

![Health badge](/badges/mjacobus-gof/health.svg)

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

PHPackages © 2026

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