当前位置: 首页>>代码示例>>PHP>>正文


PHP f2函数代码示例

本文整理汇总了PHP中f2函数的典型用法代码示例。如果您正苦于以下问题:PHP f2函数的具体用法?PHP f2怎么用?PHP f2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了f2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: g2

function g2()
{
    foreach ($GLOBALS['usr_langs'] as $lang) {
        f2();
        echo $lang . ' ';
    }
}
开发者ID:michaelprem,项目名称:phc,代码行数:7,代码来源:26396.php

示例2: f1

function f1($a)
{
    echo $a;
    $a = htmlspecialchars($a);
    echo $a;
    $a = htmlspecialchars($a);
    $a = f2($a);
}
开发者ID:void-in,项目名称:SCARY,代码行数:8,代码来源:functions6.php

示例3: f3

function f3()
{
    /*
     * Global requires a variable_name
     */
    // global f1();						// Illegal
    global ${f2()};
    // Legal
    // global $c->d;						// Illegal
}
开发者ID:michaelprem,项目名称:phc,代码行数:10,代码来源:variable_name.php

示例4: main

function main()
{
    f1();
    f2();
    f3();
    f4();
    f5();
    f6();
    f7();
    f8();
}
开发者ID:n3b,项目名称:hiphop-php,代码行数:11,代码来源:extract.php

示例5: f2

<?php

# [OK]
function f2($b)
{
    $b = htmlspecialchars($b);
    return $b;
}
$A = $_POST['b'];
$A = f2($A);
echo $A;
开发者ID:void-in,项目名称:SCARY,代码行数:11,代码来源:functions0.php

示例6: f2

<?php

function f2($b)
{
    $b = htmlspecialchars($b);
    return $b;
    # filtering left side permanently
}
echo f2($_GET['a']);
# NOTHING
echo $_GET['a'];
# XSS
开发者ID:void-in,项目名称:SCARY,代码行数:12,代码来源:volatile1.php

示例7: f1

<?php

function f1()
{
    debug_print_backtrace();
}
function f2($arg1, $arg2)
{
    f1();
    yield;
    // force generator
}
function f3($gen)
{
    $gen->rewind();
    // trigger run
}
$gen = f2('foo', 'bar');
f3($gen);
开发者ID:badlamer,项目名称:hhvm,代码行数:19,代码来源:backtrace.php

示例8: f2

//*/
///*
// 2 default followed by one non-default; unusual, but permitted
function f2($p1 = 100, $p2 = 1.23, $p3)
{
    $argList = func_get_args();
    echo "f2: # arguments passed is " . count($argList) . "\n";
    foreach ($argList as $k => $e) {
        echo "\targ[{$k}] = >{$e}<\n";
    }
    echo "\$p1: " . ($p1 == NULL ? "NULL" : $p1) . ", \$p2: " . ($p2 == NULL ? "NULL" : $p2) . ", \$p3: " . ($p3 == NULL ? "NULL" : $p3) . "\n";
}
f2();
f2(10);
f2(10, 20);
f2(10, 20, 30);
//*/
///*
// 1 default followed by one non-default followed by 1 default; unusual, but permitted
function f3($p1 = 100, $p2, $p3 = "abc")
{
    $argList = func_get_args();
    echo "f3: # arguments passed is " . count($argList) . "\n";
    foreach ($argList as $k => $e) {
        echo "\targ[{$k}] = >{$e}<\n";
    }
    echo "\$p1: " . ($p1 == NULL ? "NULL" : $p1) . ", \$p2: " . ($p2 == NULL ? "NULL" : $p2) . ", \$p3: " . ($p3 == NULL ? "NULL" : $p3) . "\n";
}
f3();
f3(10);
f3(10, 20);
开发者ID:mfsousa,项目名称:php-langspec,代码行数:31,代码来源:default_arguments.php

示例9: f1

$x = 2;
function f1($par)
{
    var_dump($par);
    $par *= 2;
}
f1($x);
// int(2)
var_dump($x);
// int(2)
function f2(&$par)
{
    var_dump($par);
    $par *= 2;
}
f2($x);
// int(2)
var_dump($x);
// int(4)
function f3(&$par)
{
    global $par;
    var_dump($par);
    $par *= 2;
}
f3($x);
// NULL
var_dump($x);
// int(4)
/*
 * signature ::= '&'? IDENT formal_parameter*
开发者ID:michaelprem,项目名称:phc,代码行数:31,代码来源:refs.php

示例10: print_level


//.........这里部分代码省略.........
         $gar_PirmsRed = $m['LBruto'] / 100;
         if ($this->MyPOST['noapalot_garumu'] == '1') {
             $gar_PirmsRed = floor($m['LBruto'] / 10) / 10;
         } elseif ($this->MyPOST['noapalot_garumu'] == '2') {
             $gar_PirmsRed = (floor($m['LBruto'] / 10) + 0.5) / 10;
         }
         //---Tiek pārbaudīts, vai garums tiek ņemts kā nominālais garums, vai notiek nominālā garuma aprēķināšana, no kura tiks rēķināts Neto tilpums!-------------------------------------------------------------------------
         $gar_PecRed = gAtskaite::nom($gar_PirmsRed, $virsmeri, $min_virsmers);
         if ($this->MyPOST['is_vika'] == 'on') {
             $gar_PecRed = $m['LPecReduc'] / 100;
         }
         //---Tiek aprēķināts nominālais garums pirms pirms redukcijas, lai varētu aprēķināt tilpumu bez virsmēra!-------------------------------------------------------------------------
         $gar_NomPirsmRed = gAtskaite::nom($gar_PirmsRed, $virsmeri, $min_virsmers);
         //----------------------------------------------------------------------------
         $diam_TievPirmsRed = $m['DBruto'] / 1000;
         $diam_VidusPirmsRed = $m['DBruto'] / 1000;
         $diam_ResPirmsRed = $m['DBruto'] / 1000;
         $rauk_koef = get_raukums_no_diam($raukums, $diam_TievPirmsRed * 1000);
         if ($this->MyPOST['noapalot_diametru'] == 'on') {
             $diam_TievPirmsRed = (floor($m['DBruto'] / 10) + 0.5) / 100;
             $diam_VidusPirmsRed = (floor($m['DBruto'] / 10) + 0.5) / 100;
             $diam_ResPirmsRed = (floor($m['DBruto'] / 10) + 0.5) / 100;
         }
         //----------------------------------------------------------------------------
         if ($this->MyPOST['braka_virsmers'] == 'on') {
         } else {
         }
         $DPecReduc = $m['DPecReduc'] / 1000;
         $DReduc = $DBruto - $DPecReduc;
         if ($m[brakis] != '255') {
             $irbrakis = true;
             $brkods = 'standart';
         }
         $tilpums_bruto = f2($diam_TievPirmsRed, $gar_PirmsRed, $rauk_koef, $koeficients, $gostu_tabula);
         $tilpums_neto = f2($DPecReduc, $gar_PecRed, $rauk_koef, $koeficients, $gostu_tabula);
         $tilpums_bruto_bez_virsmera = f2($diam_TievPirmsRed, $gar_NomPirsmRed, $rauk_koef, $koeficients, $gostu_tabula);
         $tilpums_virsmers = $tilpums_bruto - $tilpums_bruto_bez_virsmera;
         $tilpums_garuma_redukcija = $tilpums_bruto_bez_virsmera - $tilpums_neto;
         $tilpums_diametrs_redukcija = 0;
         //----------
         $SVBruto += $tilpums_bruto;
         if ($gostu_tabula) {
             if ($VBruto == -1 || $VReducD == -1 || $VReducL == -1 || $VVirsm == -1) {
                 $SSkaitsBad++;
             }
             if ($VBruto == -1) {
                 $VBruto = 0;
             }
             if ($VReducD == -1) {
                 $VReducD = 0;
             }
             if ($VReducL == -1) {
                 $VReducL = 0;
             }
             if ($VVirsm == -1) {
                 $VVirsm = 0;
             }
         }
         $VBrakis = 0;
         if (strlen($this->rejected_values[$key]) == 1) {
             $irbrakis = true;
             $brkods = $this->rejected_values[$key];
         }
         if (!$irbrakis) {
             /*Vai ir brakis?*/
             $SVReducD += $tilpums_diametrs_redukcija;
开发者ID:EdijsMuiznieks,项目名称:Test,代码行数:67,代码来源:c_report.inc_2009.php

示例11: array

{
    $arr = array(1, 2, 3);
    foreach ($arr as &$v1) {
        foreach ($arr as $v2) {
            return;
        }
    }
}
function f3()
{
    $arr = array(1, 2, 3);
    foreach ($arr as $v1) {
        foreach ($arr as &$v2) {
            return;
        }
    }
}
function f4()
{
    $arr = array(1, 2, 3);
    foreach ($arr as &$v1) {
        foreach ($arr as &$v2) {
            return;
        }
    }
}
f1();
f2();
f3();
f4();
echo "Done\n";
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:return-from-foreach.php

示例12: f1

<?php

# not entry point, vuln
function f1($a)
{
    echo $a;
}
function f2($b)
{
    echo $_GET['a'];
}
if (!defined('SOME_CONST')) {
    die;
}
f2(3);
开发者ID:void-in,项目名称:SCARY,代码行数:15,代码来源:not_entry_point_vuln.php

示例13: f2

    echo "f1 fetch\n";
    (yield $row);
}
function f2()
{
    $db = new db();
    $obj = $db->async_query('select sleep(1)');
    echo "f2 async_query\n";
    (yield $obj);
    $row = $db->fetch();
    echo "f2 fetch\n";
    (yield $row);
}
$start = microtime();
$gen1 = f1();
$gen2 = f2();
$gen1->current();
$gen2->current();
$gen1->next();
$gen2->next();
$ret1 = $gen1->current();
$ret2 = $gen2->current();
var_dump($ret1);
var_dump($ret2);
$end = microtime();
echo "Total time: ", $end - $start;
class db
{
    static $links;
    private $obj;
    function getConn()
开发者ID:silentred,项目名称:learning-path,代码行数:31,代码来源:async-mysql.php

示例14: f

function f()
{
    f2();
}
开发者ID:Halfnhav4,项目名称:pfff,代码行数:4,代码来源:functions.php

示例15: f2

echo "--------------- test type hint class-name ---------------------\n";
class C1
{
}
class D1 extends C1
{
}
function f2(C1 $p1)
{
    echo "Inside " . __METHOD__ . "\n";
    var_dump($p1);
}
//f2(123); // Argument 1 passed to f1() must be an instance of C1, integer give
//f2([10,20]);    // Argument 1 passed to f2() must be an instance of C1, array given
f2(new C1());
f2(new D1());
echo "--------------- test type hint object ---------------------\n";
function f3(object $p1)
{
    echo "Inside " . __METHOD__ . "\n";
    var_dump($p1);
}
//f3(123); // Argument 1 passed to f1() must be an instance of object, integer given
//f3([10,20]);    // Argument 1 passed to f2() must be an instance of object, array given
//f3(new C1);         // must be an instance of object, instance of C1 given
// object is not a special/recognized marker in this context
echo "--------------- test type hint interface-name ---------------------\n";
interface I1
{
}
interface I2 extends I1
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:type_hints.php


注:本文中的f2函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。