004.phpt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --TEST--
  2. gzfile() with various invalid params
  3. --SKIPIF--
  4. <?php if (!extension_loaded("zlib")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. var_dump(gzfile());
  8. var_dump(gzfile("nonexistent_file_gzfile",1));
  9. var_dump(gzfile(1,1,1));
  10. var_dump(gzfile(dirname(__FILE__)."/004.txt.gz"));
  11. var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", 1));
  12. echo "Done\n";
  13. ?>
  14. --EXPECTF--
  15. Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d
  16. NULL
  17. Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d
  18. bool(false)
  19. Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d
  20. NULL
  21. array(6) {
  22. [0]=>
  23. string(36) "When you're taught through feelings
  24. "
  25. [1]=>
  26. string(26) "Destiny flying high above
  27. "
  28. [2]=>
  29. string(38) "all I know is that you can realize it
  30. "
  31. [3]=>
  32. string(18) "Destiny who cares
  33. "
  34. [4]=>
  35. string(19) "as it turns around
  36. "
  37. [5]=>
  38. string(39) "and I know that it descends down on me
  39. "
  40. }
  41. array(6) {
  42. [0]=>
  43. string(36) "When you're taught through feelings
  44. "
  45. [1]=>
  46. string(26) "Destiny flying high above
  47. "
  48. [2]=>
  49. string(38) "all I know is that you can realize it
  50. "
  51. [3]=>
  52. string(18) "Destiny who cares
  53. "
  54. [4]=>
  55. string(19) "as it turns around
  56. "
  57. [5]=>
  58. string(39) "and I know that it descends down on me
  59. "
  60. }
  61. Done