PageRenderTime 52ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  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. }