fork download
  1. <?php
  2.  
  3. $tests = [
  4. "1...1",
  5. "2...2",
  6. "10...10",
  7. "(1.).(.1)",
  8. "1. . .1",
  9. "5.32..7",
  10. "3..(5.67)",
  11. "3. . 5.67",
  12. "3.14 . 1.41"
  13. ];
  14.  
  15. foreach($tests as $test)
  16. {
  17. printf("%-12s = ", $test);
  18. eval("echo $test;");
  19. echo PHP_EOL;
  20. }
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
1...1        = 10.1
2...2        = 20.2
10...10      = 100.1
(1.).(.1)    = 10.1
1. . .1      = 10.1
5.32..7      = 5.320.7
3..(5.67)    = 35.67
3. . 5.67    = 35.67
3.14 . 1.41  = 3.141.41