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

24 linhas
376 B
PHP

<?php
$a = array();
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
var_dump(count($a));
$b = array();
$b[0] = 7;
$b[5] = 9;
$b[10] = 11;
var_dump(count($b));
var_dump(count(null));
var_dump(count(false));
$food = array(
"fruits" => array("orange", "banana", "apple"),
"veggie" => array("carrot", "collard", "pea")
);
var_dump(count($food, COUNT_RECURSIVE));
var_dump(count($food));