bug69628.phpt 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --TEST--
  2. Bug #69628: GLOB_BRACE with multiple brackets within the braces fails
  3. --SKIPIF--
  4. <?php
  5. if (!defined('GLOB_BRACE')) {
  6. die('skip this test requires GLOB_BRACE support');
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. $file_path = __DIR__;
  12. // temp dirname used here
  13. $dirname = "$file_path/bug69628";
  14. // temp dir created
  15. mkdir($dirname);
  16. // temp files created
  17. file_put_contents("$dirname/image.jPg", '');
  18. file_put_contents("$dirname/image.gIf", '');
  19. file_put_contents("$dirname/image.png", '');
  20. sort_var_dump(glob("$dirname/*.{[jJ][pP][gG],[gG][iI][fF]}", GLOB_BRACE));
  21. function sort_var_dump($results) {
  22. sort($results);
  23. var_dump($results);
  24. }
  25. ?>
  26. --CLEAN--
  27. <?php
  28. $file_path = __DIR__;
  29. unlink("$file_path/bug69628/image.jPg");
  30. unlink("$file_path/bug69628/image.gIf");
  31. unlink("$file_path/bug69628/image.png");
  32. rmdir("$file_path/bug69628/");
  33. ?>
  34. --EXPECTF--
  35. array(2) {
  36. [0]=>
  37. string(%d) "%s/bug69628/image.gIf"
  38. [1]=>
  39. string(%d) "%s/bug69628/image.jPg"
  40. }