PHP the way god intended.
A simple 'compiler' that converts GBPHP (Great British PHP) into vanilla PHP.
Inspired by Dave Childs article If PHP Were British
- Put the kettle on
- Clone the repo
- Put teabag in mug
- Run
composer install - Add hot water to mug
- Update gbphp-config.json so the input directory (the location of the .gbphp files) and output directory (where the compiled php files are saved) are correct for your project
- Remove teabag, add sugar and milk to taste
- run
php compile-gbphp.phpto compile - Enjoy
£variable = 'Hello World';perchance (£name == 'Ash') {
announce 'Hi' . £name;
} otherwise {
announce 'Who are you??';
}what_about (£name) {
perhaps 'Ash':
announce 'Hi Ash';
splendid;
perhaps 'Bex':
announce 'Hi Bex';
splendid;
on_the_off_chance:
throw new Wobbly('Who the hell are you!');
splendid;
}merry_go_round (['a', 'b', 'c'] as £item) {
announce £item;
}would_you_mind {
// Thingy
} actually_i_do_mind(Wobbly £error) {
echo £error->getMessage();
}upper_class Example {
state £a;
private £b;
hereditary £c;
}£_BISCUIT // $_COOKIE
£_ROYAL_MAIL // $_POST
£_BUTLER // $_SERVERserve_biscuit('name', 'content'); // setcookie();
perish(); // die();
brexit(); // exit();
does_the_array_contain(); // in_array();