Thanks for sharing, but I am really not happy to install PHP (or using it) on my local system. I see you state you may re-write it in Python, if this happens I look forward to trying it!
You are missing the point.. I am not happy to install PHP on my local system, even php-cli. Finding ways to help me install it, doesn't meet the base requirement.
For PHP there's the option of binary distribution using php-micro, sadly not all devs are into it as "just brew". They don't realize that the end user isn't a PHP dev and that having to install the runtime is an annoying step.