Arquivos
hhvm/hphp/test/slow/ext_array/array_diff_uassoc.php
T
Jordan DeLong 9e127b9831 Rewrite TestExtArray in php
Most of this is ported over, except some omissions:
  - array_filter, array_key_exists (suspected we had coverage already;
    one is a bytecode, and one was rewritten in hhas recently)
  - some random cases distinguishing init_null_variant vs. null_variant
2013-06-18 16:23:18 -07:00

27 linhas
388 B
PHP

<?php
function comp_func($n1,$n2) {
$n1=(int)$n1; $n2=(int)$n2;
return $n1 === $n2 ? 0 : ($n1 > $n2 ? 1 : -1);
}
function a() {
$array1 = array(
"a" => "green",
"b" => "brown",
"c" => "blue",
"red"
);
$array2 = array(
"a" => "green",
"yellow",
"red"
);
$result = array_diff_uassoc($array1, $array2, "comp_func");
var_dump($result);
}
a();