本文整理汇总了PHP中foo函数的典型用法代码示例。如果您正苦于以下问题:PHP foo函数的具体用法?PHP foo怎么用?PHP foo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了foo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
function bar($x)
{
if ($x > 0) {
bar($x - 1);
}
}
function foo()
{
for ($idx = 0; $idx < 5; $idx++) {
bar($idx);
$x = strlen("abc");
}
}
//开启调试
xhprof_enable();
// cpu:XHPROF_FLAGS_CPU 内存:XHPROF_FLAGS_MEMORY
// 如果两个一起:XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
//要测试的php代码
foo();
//停止监测
$xhprof_data = xhprof_disable();
// display raw xhprof data for the profiler run
print_r($xhprof_data);
//包含工具类,在下载的 tgz 包中可以找到
//$XHPROF_ROOT = realpath(dirname(__FILE__) .'/..');
Vendor('Xhprof.autoload');
//Vendor('Xhprof.xhprof_runs');
//include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
//include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
// save raw data for this profiler run using default
// implementation of iXHProfRuns.
}
开发者ID:waqt,项目名称:kdweb,代码行数:35,代码来源:PerformanceController.class.php
示例2: go
function go()
{
foo(new dtor(1), new dtor(2));
foo(new dtor(3), new dtor(4));
foo(new dtor(5), new dtor(6));
foo(new dtor(7), new dtor(8));
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:concat_dtor.php
示例3: test
function test($x, $a)
{
$x = foo($a);
if ($x) {
$x->foo();
}
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:671.php
示例4: bar
function bar()
{
$k = "asd";
$z =& $k;
$y = foo();
echo $z;
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:refcount002.php
示例5: bar
public static function bar($str)
{
switch ($str) {
case "specific":
echo "in specific case";
break;
case "common_1":
case "common_2":
echo "in common case";
break;
case "fallthrough":
echo "will fall through";
// FALLTHROUGH
// FALLTHROUGH
case "dummy":
echo "dummy case";
break;
default:
echo "I guess this is the end, my friend";
}
echo "\n";
$y = true;
$z = 41;
switch (true) {
case foo($str):
echo "helloooo";
break;
case $y && $z + 1 == 42:
echo "nevermind";
break;
}
echo "\n";
}
开发者ID:badlamer,项目名称:hhvm,代码行数:33,代码来源:switch.php
示例6: main
function main()
{
$x = throwFromCallee(1);
var_dump($x);
$x = foo(2);
var_dump($x);
}
开发者ID:afaltz,项目名称:hhvm,代码行数:7,代码来源:flow_excep.php
示例7: bar
function bar($a, $b)
{
if ($a) {
$value = $a * foo(1, 2);
}
return 1 / $b;
}
开发者ID:lsqtongxin,项目名称:hhvm,代码行数:7,代码来源:59.php
示例8: testRuleNotAppliesToShortVariableNameInCatchStatement
function testRuleNotAppliesToShortVariableNameInCatchStatement()
{
try {
foo();
} catch (Exception $e) {
}
}
开发者ID:kingsj,项目名称:core,代码行数:7,代码来源:testRuleNotAppliesToShortVariableNameInCatchStatement.php
示例9: bar
function bar()
{
for ($i = 0; $i < 4; $i++) {
if ($i > 1 && !function_exists('foo')) {
function foo()
{
echo "foo called\n";
}
}
$foo = 'foo';
if (function_exists($foo)) {
foo();
} else {
echo "foo does not exists\n";
}
}
for ($i = 0; $i < 4; $i++) {
if ($i > 1 && !class_exists('goo')) {
class goo
{
function goo()
{
echo "goo called\n";
}
}
}
$goo = 'goo';
if (class_exists($goo)) {
$a = new goo();
} else {
echo "goo does not exists\n";
}
}
}
开发者ID:badlamer,项目名称:hhvm,代码行数:34,代码来源:1216.php
示例10: bar
function bar()
{
$x = foo();
$x[123] = 2;
$x['asdasdasd'] = new stdclass();
return $x;
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:array_045.php
示例11: test
function test()
{
$a = foo(1);
$a = foo($a);
$a = foo($a);
print_r($a, true);
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:serialization_limit.php
示例12: bar
function bar()
{
$x = foo();
$x->heh();
$x->heh();
return $x;
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:fpushobj_001.php
示例13: main
function main()
{
$x = foo(array(1, 2, 3));
foreach ($x as $k => $v) {
var_dump($v);
}
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:array_057.php
示例14: foo
function foo($lv = 1, $iNodeId = 1, $limit, $showallart, $oAN, $oMAI, &$tmp, $setting)
{
if ($lv < 0) {
return;
}
$aNodes = $oAN->get_nodes($iNodeId);
if (is_array($aNodes)) {
foreach ($aNodes as $val) {
if ($val['ifpub'] == 'false') {
continue;
}
foo($lv - 1, $val['node_id'], $limit, $showallart, $oAN, $oMAI, $tmp['child'][$val['node_id']], $setting);
if (empty($tmp['child'][$val['node_id']])) {
unset($tmp[$val['node_id']]);
}
$tmp['child'][$val['node_id']]['info'] = $val;
}
}
if ($showallart) {
if (!$limit) {
return;
}
#if( $lv==$setting['lv'] ) return false;
$tmp['article'] = $oMAI->getList_1('*', array('node_id' => $iNodeId, 'ifpub' => 'true', 'nochildren' => true), 0, $limit);
}
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:26,代码来源:widget_article.php
示例15: bar
function bar()
{
foo(1);
3;
foo(1);
4;
}
开发者ID:Halfnhav4,项目名称:pfff,代码行数:7,代码来源:remove_whole_line.php
示例16: foo
function foo($p)
{
if ($p) {
foo($p);
}
echo $p;
}
开发者ID:9Yg1rxeSeha90ZU1,项目名称:pixy,代码行数:7,代码来源:test093.php
示例17: bar
function bar()
{
$x = foo();
foreach ($x as $k) {
echo $k;
echo "\n";
}
}
开发者ID:badlamer,项目名称:hhvm,代码行数:8,代码来源:continuation_001.php
示例18: test3
function test3()
{
if (foo(0)) {
$a = 1;
}
$x = new StdClass();
return $a::foo;
}
开发者ID:badlamer,项目名称:hhvm,代码行数:8,代码来源:65.php
示例19: bar
function bar($seconds)
{
$bar = str_repeat('telltale', rand(1111, 99999));
if ($seconds > 0) {
sleep(rand($seconds - 1, $seconds + 1));
foo($seconds - 1);
}
}
开发者ID:renanbr,项目名称:telltale,代码行数:8,代码来源:basic.php
示例20: main
function main()
{
try {
foo();
} catch (Exception $e) {
echo "Caught exception\n";
}
}
开发者ID:badlamer,项目名称:hhvm,代码行数:8,代码来源:finally_foreach_1.php
注:本文中的foo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论