/hphp/test/zend/good/ext/standard/tests/math/ceil_error.php

http://github.com/facebook/hiphop-php · PHP · 17 lines · 11 code · 2 blank · 4 comment · 0 complexity · eba4611b81bce441f6d70f75c9801a5d MD5 · raw file

  1. <?hh
  2. /* Prototype : float ceil ( float $value )
  3. * Description: Round fractions up.
  4. * Source code: ext/standard/math.c
  5. */
  6. <<__EntryPoint>> function main(): void {
  7. echo "*** Testing ceil() : error conditions ***\n";
  8. $arg_0 = 1.0;
  9. $extra_arg = 1;
  10. echo "\nToo many arguments\n";
  11. try { var_dump(ceil($arg_0, $extra_arg)); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
  12. echo "\nToo few arguments\n";
  13. try { var_dump(ceil()); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
  14. echo "===Done===";
  15. }