PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/facebook/hiphop-php
PHP | 16 lines | 14 code | 2 blank | 0 comment | 1 complexity | 262caedf98849bfd632df3f5c4afadc1 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. function key_compare_func($a, $b)
  3. {
  4. if ($a === $b) {
  5. return 0;
  6. }
  7. return ($a > $b)? 1:-1;
  8. }
  9. <<__EntryPoint>> function main(): void {
  10. $array1 = darray["a" => "green", "b" => "Brown", 'c' => 'blue', 0 => 'red'];
  11. $array2 = darray["a" => "green", "b" => "Brown", 'c' => 'blue', 0 => 'red'];
  12. $result = array_diff_uassoc($array1, $array2, "key_compare_func");
  13. print_r($result);
  14. }