A PHP textual expression parser, parses strings for mathematical expressions and returns the result
Open Issues: 0
This package is not auto-updated.
Last update: 2023-03-18 06:34:03 UTC
A PHP expression parser. This tool was largely inspired by snips of code I came across on the web while looking for some form of an expression DSL. The approach inspired me enough to feel it deserved sharing. Unfortunately these snippets had no name associated with them and I am therefor unable to attribute the inspirative work to its inceptor.
<?php $expression = new \Expressive\Parser('(2+2)*sqrt(4)'); echo $expression; // 8
this is intended more as an example use
> bin/expr math > (2+2)*sqrt(4) 8 math > exit >