Arquivos
hhvm/hphp/test/slow/ext_array/array_map.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

18 linhas
322 B
PHP

<?php
function cube($s1) { return $s1*$s1*$s1; }
$a = array(1, 2, 3, 4, 5);
$b = array_map("cube", $a);
var_dump($b);
$b = array_map(null, $a);
var_dump($b);
$b = array_map(null, array('x' => 6, 0 => 7));
var_dump($b);
var_dump(
array_map(
null,
array('x' => 6, 0 => 7),
array(array('a', 'b'), true)
)
);