/hphp/test/zend/bad/ext/standard/tests/math/ceil_basic.php

http://github.com/facebook/hiphop-php · PHP · 37 lines · 30 code · 3 blank · 4 comment · 1 complexity · e65fd0d67473135f5052422a15a7415e MD5 · raw file

  1. <?php
  2. /* Prototype : float ceil ( float $value )
  3. * Description: Round fractions up.
  4. * Source code: ext/standard/math.c
  5. */
  6. echo "*** Testing ceil() : basic functionality ***\n";
  7. $values = array(0,
  8. -0,
  9. 0.5,
  10. -0.5,
  11. 1,
  12. -1,
  13. 1.5,
  14. -1.5,
  15. 2.6,
  16. -2.6,
  17. 037,
  18. 0x5F,
  19. "10.5",
  20. "-10.5",
  21. "3.95E3",
  22. "-3.95E3",
  23. "039",
  24. "0x5F",
  25. true,
  26. false,
  27. null,
  28. );
  29. for ($i = 0; $i < count($values); $i++) {
  30. $res = ceil($values[$i]);
  31. var_dump($res);
  32. }
  33. ?>
  34. ===Done===