/hphp/test/zend/bad/ext/standard/tests/array/array_unique_variation8.php

http://github.com/facebook/hiphop-php · PHP · 25 lines · 11 code · 5 blank · 9 comment · 1 complexity · cbcc36143c41874db9d8b2f5942ddefe MD5 · raw file

  1. <?php
  2. /* Prototype : array array_unique(array $input)
  3. * Description: Removes duplicate values from array
  4. * Source code: ext/standard/array.c
  5. */
  6. /*
  7. * Testing the functionality of array_unique() by passing
  8. * two dimensional arrays for $input argument.
  9. */
  10. echo "*** Testing array_unique() : two dimensional array for \$input argument ***\n";
  11. // initialize the 2-d array
  12. $input = array(
  13. array(1, 2, 3, 1),
  14. array("hello", "world", "str1" => "hello", "str2" => 'world'),
  15. array(1 => "one", 2 => "two", "one", 'two'),
  16. array(1, 2, 3, 1)
  17. );
  18. var_dump( array_unique($input, SORT_STRING) );
  19. echo "Done";
  20. ?>