/hphp/test/zend/bad/ext/standard/tests/general_functions/uniqid_error.php
PHP | 27 lines | 18 code | 5 blank | 4 comment | 1 complexity | 1953803b413792b214b207cc86a85707 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
- <?php
- /* Prototype : string uniqid ([ string $prefix= "" [, bool $more_entropy= false ]] )
- * Description: Gets a prefixed unique identifier based on the current time in microseconds.
- * Source code: ext/standard/uniqid.c
- */
- echo "*** Testing uniqid() : error conditions ***\n";
-
- echo "\n-- Testing uniqid() function with more than expected no. of arguments --\n";
- $prefix = null;
- $more_entropy = false;
- $extra_arg = false;
- var_dump(uniqid($prefix, $more_entropy, $extra_arg));
-
- echo "\n-- Testing uniqid() function with invalid values for \$prefix --\n";
- class class1{}
- $obj = new class1();
- $res = fopen(__FILE__, "r");
- $array = array(1,2,3);
-
- uniqid($array, false);
- uniqid($res, false);
- uniqid($obj, false);
-
- fclose($res);
-
- ?>
- ===DONE===