fork download
  1. <?php
  2.  
  3. $equation = '2 + 2 * 2';
  4. $result = eval("return $equation;");
  5.  
  6. var_dump($result);
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
int(6)