2017 © Pedro Peláez
 

library phpep

PHP Expression Parser - ported from soney/jsep http://jsep.from.so

image

benyitzhaki/phpep

PHP Expression Parser - ported from soney/jsep http://jsep.from.so

  • Wednesday, March 28, 2018
  • by benyitzhaki
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,140 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 220 % Grown

The README.md

phpep: A Tiny PHP Expression Parser - Ported from jsep

phpep is a simple expression parser written in PHP, ported from JavaScript. It can parse expressions but not operations. The difference between expressions and operations is akin to the difference between a cell in an Excel spreadsheet vs. a proper JavaScript program., (*1)

Why phpep?

I wanted a lightweight, tiny parser to be included in one of my other libraries. jsep provided this functionality. I also wanted to be able to parse these expressions in my PHP projects, which led me to porting jsep., (*2)

Usage

PHP

require('phpep.php');
$expr = new PHPEP("1 + 1");
$stack = $expr->exec();
var_dump($stack);

Custom Operators

// Not yet implemented.

Install dependencies

Dependencies are managed using composer. To install the dependencies, run the following command: php composer.phar install, (*3)

PHPUnit Tests

This library is using php unit testing framework. In order to test the library, run the following command: /vendor/bin/phpunit, (*4)

License

phpep is under the MIT license. See LICENSE file., (*5)

Thanks

Thanks to Stephen Oney for the original jsep project Some parts of the latest version of jsep were adapted from the esprima parser., (*6)

The Versions

28/03 2018

dev-master

9999999-dev

PHP Expression Parser - ported from soney/jsep http://jsep.from.so

  Sources   Download

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires