PHP Classes

Simple RPN Interpreter: Evaluate reverse polish notation expressions

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 735 All time: 4,545 This week: 560Up
Version License PHP version Categories
rpn 1.0.0GNU General Publi...4.0.0Emulators, Math, Parsers


This class can be used parse and evaluate RPN (reverse polish notation) expressions.

It can parse a mathematical expressions with operands and operators in reverse polish and evaluates the expression.

If the expression is split in multiple lines, it can evaluate each line individually.

Currently it supports the operators: +, - , *, /, IF, THEN, SWAP, DUP, =, <>, >, <. >= and <= .

Innovation Award
PHP Programming Innovation award nominee
August 2007
Number 3

Prize: One copy of Delphi for PHP
RPN (Reverse Polish Notation) is a way to present the operands and operators of mathematical expressions.

RPN has been most notably used in Hewlett-Packard scientific calculators.

This class provides a solution to parse and evaluate mathematical expressions presented with RPN.

Manuel Lemos
Picture of Arturo Gonzalez-Mata Santana
Name: Arturo Gonzalez-Mata ... <contact>
Classes: 1 package by
Country: Spain Spain
Age: 67
All time rank: 277873 in Spain Spain
Week rank: 264 Up9 in Spain Spain Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file rpn.class.php Class rpn parser
Accessible without login Plain text file example.php Example example of use of rpn.class.php with forms
Accessible without login Plain text file example2.php Example example of use of rpn.class.php with server files
Accessible without login Plain text file license.txt Lic. GPL license for RPN.class
Accessible without login Plain text file RPN.txt Data rpn "program" file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,545
This week:560Up