<?php $equation = '2 + 2 * 2';$result = eval("return $equation;"); var_dump($result);
Standard input is empty
int(6)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!