/hphp/test/zend/good/ext/standard/tests/math/ceil_error.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
- <?hh
- /* Prototype : float ceil ( float $value )
- * Description: Round fractions up.
- * Source code: ext/standard/math.c
- */
- <<__EntryPoint>> function main(): void {
- echo "*** Testing ceil() : error conditions ***\n";
- $arg_0 = 1.0;
- $extra_arg = 1;
- echo "\nToo many arguments\n";
- try { var_dump(ceil($arg_0, $extra_arg)); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
- echo "\nToo few arguments\n";
- try { var_dump(ceil()); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
- echo "===Done===";
- }