gzencode_variation2-win32.phpt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Test gzencode() function : variation - verify header contents with all encoding modes
  3. --EXTENSIONS--
  4. zlib
  5. --SKIPIF--
  6. <?php
  7. if( substr(PHP_OS, 0, 3) != "WIN" ) {
  8. die("skip.. only for Windows");
  9. }
  10. include 'func.inc';
  11. if (version_compare(get_zlib_version(), "1.2.11") < 0) {
  12. die("skip - at least zlib 1.2.11 required, got " . get_zlib_version());
  13. }
  14. ?>
  15. --FILE--
  16. <?php
  17. echo "*** Testing gzencode() : variation ***\n";
  18. $data = "A small string to encode\n";
  19. echo "\n-- Testing with each encoding_mode --\n";
  20. var_dump(bin2hex(gzencode($data, -1)));
  21. var_dump(bin2hex(gzencode($data, -1, FORCE_GZIP)));
  22. var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE)));
  23. ?>
  24. --EXPECT--
  25. *** Testing gzencode() : variation ***
  26. -- Testing with each encoding_mode --
  27. string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
  28. string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
  29. string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"