PHPackages                             igorw/chicken - 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. igorw/chicken

ActiveLibrary

igorw/chicken
=============

Chicken VM written in PHP.

2284[1 issues](https://github.com/igorw/chicken-php/issues)PHP

Since Dec 14Pushed 12y ago3 watchersCompare

[ Source](https://github.com/igorw/chicken-php)[ Packagist](https://packagist.org/packages/igorw/chicken)[ RSS](/packages/igorw-chicken/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

chicken-php
===========

[](#chicken-php)

[![chicken](doc/chicken.png)](doc/chicken.png)

PHP implementation of the [Chicken VM](http://torso.me/chicken), ported from JavaScript.

What is Chicken? It's a language based around one single symbol: `chicken`. Actually, there are a few tokens: `chicken`, space and newline. The chicken count of a line corresponds to an opcode.

It roughly translates into a form of assembly. The supported operations are `chicken` (string), `+`, `-`, `*`, `==`, load, store, jump, chars and literal numbers.

The memory model has pointers to the stack itself and input as the first two elements of the stack. Those are followed by the opcodes, delimited by 0. The opcodes then run until the 0 is reached, at which point the head of the stack is returned. Every operation consumes one or more elements, then pushes its result onto the stack.

The reference implementation is written in JavaScript and is a piece of art.

Usage
-----

[](#usage)

### `chicken`

[](#chicken)

Low-level chicken interpreter.

Quine:

```
$ echo chicken | bin/chicken

```

Cat:

```
$ echo chicken | bin/chicken foo
