<commit_before>PHP-BrainFuck
=============

A brainfuck interpreter for PHP

This repository goes along with my blog post: [The Brain Is A Muscle](http://blog.ircmaxell.com/2012/12/the-brain-is-muscle.html).

It also is result of this YouTube video: [BrainFuck Implementation In PHP](https://www.youtube.com/watch?v=s3CncuzRzFA)

## Install
Install PHP-BrainFuck using [Composer](http://getcomposer.org/)
```
php composer.phar require ircmaxell/php-brain-fuck
```

## Usage

```php
<?php
// require_once 'vendor/autoload.php';

$Language = new Language;

$output = $Language->run('++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.');
var_dump($t);

// Output:
/*
array (size=13)
  0 => int 72
  1 => int 101<commit_msg>developers<commit_after>PHP-BrainFuck
=============

A brainfuck interpreter for PHP

This repository goes along with my blog post: [The Brain Is A Muscle](http://blog.ircmaxell.com/2012/12/the-brain-is-muscle.html).

It also is result of this YouTube video: [BrainFuck Implementation In PHP](https://www.youtube.com/watch?v=s3CncuzRzFA)

## Install
Install PHP-BrainFuck using [Composer](http://getcomposer.org/)
```
php composer.phar require ircmaxell/php-brain-fuck
```

## Usage

```php
<?php
// require_once 'vendor/autoload.php';

use BrainFuck\Language;

$Language = new Language;

$output = $Language->run('++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.');
var_dump($t);

// Output:
/*
array (size=13)
  0 => int 72
  1 => int 101
{'fraction_non_alphanumeric': 0.2840909090909091, 'fraction_numerical': 0.020202020202020204, 'mean_word_length': 4.301003344481606, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6551176', 'n_tokens_mistral': 632, 'n_tokens_neox': 567, 'n_words': 121}