PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/general_functions/uniqid_error.php

http://github.com/facebook/hiphop-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
  1. <?php
  2. /* Prototype : string uniqid ([ string $prefix= "" [, bool $more_entropy= false ]] )
  3. * Description: Gets a prefixed unique identifier based on the current time in microseconds.
  4. * Source code: ext/standard/uniqid.c
  5. */
  6. echo "*** Testing uniqid() : error conditions ***\n";
  7. echo "\n-- Testing uniqid() function with more than expected no. of arguments --\n";
  8. $prefix = null;
  9. $more_entropy = false;
  10. $extra_arg = false;
  11. var_dump(uniqid($prefix, $more_entropy, $extra_arg));
  12. echo "\n-- Testing uniqid() function with invalid values for \$prefix --\n";
  13. class class1{}
  14. $obj = new class1();
  15. $res = fopen(__FILE__, "r");
  16. $array = array(1,2,3);
  17. uniqid($array, false);
  18. uniqid($res, false);
  19. uniqid($obj, false);
  20. fclose($res);
  21. ?>
  22. ===DONE===