string_decimals_001.phpt 536 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. String conversion with multiple decimal points
  3. --FILE--
  4. <?php
  5. function test($str) {
  6. echo "\n--> Testing $str:\n";
  7. var_dump((int)$str);
  8. var_dump((float)$str);
  9. var_dump($str > 0);
  10. }
  11. test("..9");
  12. test(".9.");
  13. test("9..");
  14. test("9.9.");
  15. test("9.9.9");
  16. ?>
  17. ===DONE===
  18. --EXPECT--
  19. --> Testing ..9:
  20. int(0)
  21. float(0)
  22. bool(false)
  23. --> Testing .9.:
  24. int(0)
  25. float(0.9)
  26. bool(true)
  27. --> Testing 9..:
  28. int(9)
  29. float(9)
  30. bool(true)
  31. --> Testing 9.9.:
  32. int(9)
  33. float(9.9)
  34. bool(true)
  35. --> Testing 9.9.9:
  36. int(9)
  37. float(9.9)
  38. bool(true)
  39. ===DONE===