PageRenderTime 40ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/good/ext/standard/tests/array/array_unique_variation5.php

http://github.com/facebook/hiphop-php
PHP | 19 lines | 7 code | 3 blank | 9 comment | 1 complexity | 58852131ac43e8cded95de2552147b9b 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. <?hh
  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. * array having duplicate keys as values.
  9. */
  10. <<__EntryPoint>> function main(): void {
  11. echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n";
  12. // initialize the array having duplicate keys
  13. $input = darray[1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", 4 => "1", 5 => "2"];
  14. var_dump( array_unique($input) );
  15. echo "Done";
  16. }