⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 count_recursive.phpt

📁 PHP v6.0 For Linux 运行环境:Win9X/ WinME/ WinNT/ Win2K/ WinXP
💻 PHPT
字号:
--TEST--count--FILE--<?phpprint "Testing NULL...\n";$arr = NULL;print "COUNT_NORMAL: should be 0, is ".count($arr, COUNT_NORMAL)."\n";print "COUNT_RECURSIVE: should be 0, is ".count($arr, COUNT_RECURSIVE)."\n";print "Testing arrays...\n";$arr = array(1, array(3, 4, array(6, array(8))));print "COUNT_NORMAL: should be 2, is ".count($arr, COUNT_NORMAL)."\n";print "COUNT_RECURSIVE: should be 8, is ".count($arr, COUNT_RECURSIVE)."\n";print "Testing hashes...\n";$arr = array("a" => 1, "b" => 2, array("c" => 3, array("d" => 5)));print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n";print "COUNT_RECURSIVE: should be 6, is ".count($arr, COUNT_RECURSIVE)."\n";print "Testing strings...\n";print "COUNT_NORMAL: should be 1, is ".count("string", COUNT_NORMAL)."\n";print "COUNT_RECURSIVE: should be 1, is ".count("string", COUNT_RECURSIVE)."\n";print "Testing various types with no second argument.\n";print "COUNT_NORMAL: should be 1, is ".count("string")."\n";print "COUNT_NORMAL: should be 2, is ".count(array("a", array("b")))."\n";$arr = array('a'=>array(NULL, NULL, NULL), 1=>array(NULL=>1, 1=>NULL),	array(array(array(array(array(NULL))))));print "Testing really cool arrays ;)\n";print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n";print "COUNT_RECURSIVE: should be 13, is ".count($arr, COUNT_RECURSIVE)."\n";?>--EXPECT--Testing NULL...COUNT_NORMAL: should be 0, is 0COUNT_RECURSIVE: should be 0, is 0Testing arrays...COUNT_NORMAL: should be 2, is 2COUNT_RECURSIVE: should be 8, is 8Testing hashes...COUNT_NORMAL: should be 3, is 3COUNT_RECURSIVE: should be 6, is 6Testing strings...COUNT_NORMAL: should be 1, is 1COUNT_RECURSIVE: should be 1, is 1Testing various types with no second argument.COUNT_NORMAL: should be 1, is 1COUNT_NORMAL: should be 2, is 2Testing really cool arrays ;)COUNT_NORMAL: should be 3, is 3COUNT_RECURSIVE: should be 13, is 13

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -