Forge: A Tiny Calculator Language
Turn text like '3 4 + 5 *' into real answers by building your own interpreter. By the end the word parsing will never feel like magic again.
What you'll be able to build
Turn text like '3 4 + 5 *' into real answers by building your own interpreter. By the end the word parsing will never feel like magic again. Along the way you pick up real, transferable PHP skills, not just this one project:
- tokenization with explode or preg_split
- an array as a stack (array_push and array_pop)
- a match expression as a dispatch table
- closures for operators
- error handling for bad input
- writing and running test cases
A course like this one
Yours is built from your own placement, so module count and depth will differ. This map shows what a advanced-level PHP learner building Forge actually gets.
- Module 1: Idiomatic PHP: string functions and the array_* family5 lessons
Builds the production-ready version of the script for your forge.
- Module 2: Closures, arrow fns, and higher-order array functions5 lessons
Builds the production-ready version of the reusable class for your forge.
- Module 3: Classes, interfaces, traits, and type declarations5 lessons
Builds the production-ready version of the associative model for your forge.
- Module 4: array_map / filter / reduce and sorting associative data5 lessons
Builds the production-ready version of the array pipeline workflow for your forge.
- Module 5: Loose vs strict comparison and the match expression5 lessons
Builds the production-ready version of the function that powers your forge.
- Module 6: Exceptions, error contracts, and documented output3 lessons
Builds the production-ready version of the command-line tool for your forge.
How the lessons actually work
Every lesson has you predict what a piece of PHP code will output before you run it, then run it for real in your browser and fix what you got wrong. Each module ends in a challenge gate with hidden tests, so you can't advance until your code actually works. The course closes with a capstone that assembles everything into Forge, and a runnable proof page tied to your own code.
Common questions
How long does the Forge: A Tiny Calculator Language course take?
about 7 hours, across 6 modules and 28 lessons, at roughly 15 minutes per lesson. Your own course may run shorter or longer, since it's sized to your placement result, not a fixed template.
Do I need experience?
Yes. This is an advanced-tier PHP project, so it assumes you're already comfortable writing and reading PHP before you start.
How much does it cost?
$15 one-time, no subscription. The first module is free, so you can see exactly how the course teaches before you pay for the rest.