PageRenderTime 52ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/ext_array/array_diff.php

http://github.com/facebook/hiphop-php
PHP | 24 lines | 20 code | 4 blank | 0 comment | 0 complexity | f68077b768fed975b850e12699c9c642 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. <<__EntryPoint>>
  3. function main_array_diff() {
  4. $array1 = darray[
  5. "a" => "green",
  6. 0 => "red",
  7. 1 => "blue",
  8. 2 => "red"
  9. ];
  10. $array2 = darray[
  11. "b" => "green",
  12. 0 => "yellow",
  13. 1 => "red"
  14. ];
  15. $result = array_diff($array1, $array2);
  16. var_dump($result);
  17. $a = varray["b"];
  18. $b = varray["b", "c"];
  19. var_dump(array_diff($b, $a));
  20. }