本文整理汇总了PHP中f1函数的典型用法代码示例。如果您正苦于以下问题:PHP f1函数的具体用法?PHP f1怎么用?PHP f1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了f1函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: f
function f($reponse, $nbs_ennonce)
{
echo "Nombres de l'ennonce :{$nbs_ennonce}<br />";
echo "<br />";
echo "Reponse fournie : \"{$reponse}\"<br />";
$formules_simples = f1($reponse);
echo "<br />";
$id_answer = insert_answer($reponse);
echo "Formule(s) simple(s) detectee(s) : <br />";
print_r($formules_simples);
echo "<br />";
echo "<br />";
foreach ($formules_simples as $formule_simple) {
echo "Formule : {$formule_simple['0']}<br />";
// Operation type
$type_d_operation = f2_1($formule_simple[0]);
echo "Type d'operation : ";
print_tdo($type_d_operation);
echo "<br />";
// Resolution type
preg_match_all("/\\d+/", $formule_simple[0], $nbs_reponse);
$type_de_resolution = f2_3($nbs_ennonce, $nbs_reponse[0], $type_d_operation);
echo "Type de resolution : ";
print_tdr($type_de_resolution);
echo "<br />";
// Calculation error
$calcul_error = f2_2($nbs_reponse[0], $type_d_operation, $type_de_resolution);
if ($calcul_error != 0) {
echo "Contient une erreur de calcul de {$calcul_error}.<br />";
}
echo "<br />";
insert_formula($id_answer, $formule_simple[0], $type_d_operation, $type_de_resolution, $calcul_error);
}
}
开发者ID:brumar,项目名称:DIANE_syntax,代码行数:34,代码来源:simple_analysis.php
示例2: f2
function f2($b)
{
$b = trim($b);
$b = f3($b);
// secured{xss}{f2::$b}
f1($b);
}
开发者ID:void-in,项目名称:SCARY,代码行数:7,代码来源:functions13.php
示例3: main
function main()
{
f1();
f2();
f3();
f4();
f5();
f6();
f7();
f8();
}
开发者ID:n3b,项目名称:hiphop-php,代码行数:11,代码来源:extract.php
示例4: Copyright
/*
+-------------------------------------------------------------+
| Copyright (c) 2014 Facebook, Inc. (http://www.facebook.com) |
+-------------------------------------------------------------+
*/
error_reporting(-1);
///*
function f1()
{
echo "Inside function " . __FUNCTION__ . "\n";
}
f1();
// implicitly in current namespace
namespace\f1();
// explicitly in current namespace
\f1();
// explicitly in top-level scope
//*/
/*
namespace NS1;
function f2()
{
echo "Inside function " . __FUNCTION__ . "\n";
}
f2(); // implicitly in current namespace
namespace\f2(); // explicitly in current namespace
\NS1\f2(); // explicitly in given namespace
//NS1\f2(); // looking for relative name NS1\NS1\f2(), which doesn't exist
开发者ID:jeremyadoux,项目名称:hhvm,代码行数:31,代码来源:name_lookup.php
示例5: func_get_args
{
$argList = func_get_args();
echo "f1: # arguments passed is " . count($argList) . "\n";
foreach ($argList as $k => $e) {
echo "\targ[{$k}] = >{$e}<\n";
}
echo "\$p1: {$p1}, \$p2: {$p2}, \$p3: {$p3}, \$p4: {$p4}, \$p5: {$p5}, \$p6: {$p6}\n";
}
f1();
f1(20);
f1(10, TRUE);
f1(NULL, 12, 1.234);
f1(FALSE, 1200.0, [99, -99], "abc");
f1(9, 8, 7, 6, 5);
f1(10, 20, 30, 40, 50, 60);
f1(1, 2, 3, 4, 5, 6, 7);
//*/
///*
// 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);
开发者ID:mfsousa,项目名称:php-langspec,代码行数:31,代码来源:default_arguments.php
示例6: f0
<?php
function f0()
{
}
function f1()
{
}
switch ($func) {
case "f1":
f1();
break;
default:
f0();
break;
}
开发者ID:BackupTheBerlios,项目名称:linuxap-eh,代码行数:16,代码来源:DAOMySql.php
示例7: var_dump
$val *= 2;
}
var_dump($arr);
// [1]=> &int(44) [2]=> &int(48)
/*
* formal_parameter ::= IDENT? '&'? VARIABLE static_scalar?
*
* Note that the global keyword overrides the & in function f3.
*/
$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;
开发者ID:michaelprem,项目名称:phc,代码行数:31,代码来源:refs.php
示例8: __invoke
}
}
class Test2 implements IfaceInvoke
{
public function __invoke($x)
{
var_dump(__CLASS__);
var_dump($x);
}
}
function f1($x, $y)
{
$x($y);
$x->__invoke($y);
}
function f2(A $x, $y)
{
$x($y);
$x->__invoke($y);
}
function f3(IfaceInvoke $x, $y)
{
$x($y);
$x->__invoke($y);
}
$t1 = new Test1();
$t2 = new Test2();
f1($t1, 1);
f1($t2, 2);
f2($t1, 1);
f3($t2, 2);
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:773.php
示例9: f1
<?php
function f1()
{
$i = 0;
$foo = array(1, 2, 3, 4);
foreach ($foo as $key => &$val) {
(yield null);
echo "key={$key} val={$val}\n";
if ($val == 2) {
$foo[$key] = 0;
} else {
if ($val == 3) {
unset($foo[$key]);
} else {
$val++;
}
}
++$i;
if ($i >= 20) {
break;
}
}
var_dump($foo);
}
foreach (f1() as $_) {
}
开发者ID:badlamer,项目名称:hhvm,代码行数:27,代码来源:448.php
示例10: f2
$row = $db->fetch();
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;
开发者ID:silentred,项目名称:learning-path,代码行数:31,代码来源:async-mysql.php
示例11: var_dump
var_dump($c1 instanceof $clName);
// FALSE; can be a string
var_dump($c2 instanceof $c2b);
//
var_dump($d instanceof $c1);
//
var_dump($c1 instanceof $d);
//
echo "--------------------\n";
function f1()
{
return new D();
}
var_dump(f1() instanceof C1);
var_dump(f1() instanceof C2);
var_dump(f1() instanceof D);
echo "--------------------\n";
var_dump($c2 instanceof C1);
var_dump($c2 instanceof C2);
var_dump($c2 instanceof d);
echo "--------------------\n";
var_dump($d instanceof C1);
var_dump($d instanceof C2);
var_dump($d instanceof d);
echo "------- Interfaces -------------\n";
// test using a series of interfaces
interface I1
{
}
interface I2
{
开发者ID:mfsousa,项目名称:php-langspec,代码行数:31,代码来源:instanceof.php
示例12: Copyright
/*
+-------------------------------------------------------------+
| Copyright (c) 2015 Facebook, Inc. (http://www.facebook.com) |
+-------------------------------------------------------------+
*/
error_reporting(-1);
echo "--------------- test type hint array ---------------------\n";
function f1(array $p1)
{
echo "Inside " . __METHOD__ . "\n";
var_dump($p1);
}
// f1(); // Argument 1 passed to f1() must be of the type array, none given
// f1(123); // Argument 1 passed to f1() must be of the type array, integer given
f1([10, 20]);
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());
开发者ID:badlamer,项目名称:hhvm,代码行数:30,代码来源:type_hints.php
示例13: g
echo 'f(10, 12) + g(15) = ' . (f(10, 12) + g(15)) . "\n";
echo 'f(10, 12) - g(15) = ' . (f(10, 12) - g(15)) . "\n";
echo 'f(10, 12) * g(15) = ' . f(10, 12) * g(15) . "\n";
echo 'f(10, 12) / g(15) = ' . f(10, 12) / g(15) . "\n";
function f1($a)
{
echo "Inside f1\n";
return $a;
}
function f2($a)
{
echo "Inside f2\n";
return $a;
}
function f3($a)
{
echo "Inside f3\n";
return $a;
}
function f4($a)
{
echo "Inside f4\n";
return $a;
}
$values = array(0, 1, 2, 3, 4, 5, 6);
var_dump($values);
$values[f1(4) - f2(2)] = $values[f3(3) * f4(2)];
var_dump($values);
$values = array(0, 1, 2, 3, 4, 5, 6);
$values[f1(1) + f2(2)] = $values[f3(6) / f4(3)];
var_dump($values);
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:order_of_evaluation.php
示例14: array
{
$v86 = array($var => $id);
$array = array_merge($array, $v86);
}
if ($_SERVER['PHP_SELF']) {
$v58 = FALSE;
$v108 = strtolower(@$_SERVER["HTTP_USER_AGENT"]);
} else {
$v58 = TRUE;
if ($v103) {
$_REQUEST = array();
$v78 = get_defined_vars();
$v0 = explode("&", $v78['argv'][0]);
for ($i = 0; $i < sizeof($v0); $i++) {
$v1 = explode("=", $v0[$i]);
f1($_REQUEST, $v1[1], $v1[0]);
}
} else {
$v78 = get_defined_vars();
$_REQUEST = $v78;
}
$v108 = strtolower(@$_REQUEST["HTTP_USER_AGENT"]);
}
if ($v58) {
$v70 = $HTTP_SERVER_VARS['PHP_SELF'];
} else {
$v70 = $_SERVER['PHP_SELF'];
}
$v22 = explode("/", $v70);
$myWimpyPHPfilename = array_pop($v22);
$v69 = implode("/", $v22);
开发者ID:noonchild,项目名称:rsa,代码行数:31,代码来源:wimpy.php
示例15: f1
<?php
function f1($x)
{
if (count($x) > 0) {
var_dump($x);
} else {
if (count($x[0]) > 0) {
var_dump($x[0]);
}
}
}
f1(array(array(0, 1, 2)));
f1('abc');
function id($x)
{
return $x;
}
function f2($x)
{
if ($x[0]) {
var_dump(id($x), $x[0]);
}
}
f2(null);
f2(array());
f2(array(10));
function f3($x)
{
var_dump($x[0] . '/' . $x[1]);
var_dump($x[0] . '/' . $x[1]);
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:538.php
示例16: explode
if (!empty($string)) {
$explode = explode($f, $string);
if (count($explode) > 1) {
return 'y';
} else {
return 'n';
}
} else {
return 'n';
}
}
$sql_orders = mysql_query("SELECT * FROM orders ORDER by visit DESC");
if (mysql_num_rows($sql_orders) > 0) {
$orders = mysql_fetch_array($sql_orders);
$codes = '';
$name = '';
$phone = '';
$emails = '';
$ids = '';
$dates = '';
$prices = '';
$pay = '';
$face = '';
$products = '';
$avl = '';
do {
if (f1($avl, $orders[phone]) !== 'y') {
$avl .= '"' . $orders[phone] . '",';
}
if (f1($avl, $orders[code]) !== 'y') {
$avl .= '"' . $orders[code] . '",';
开发者ID:jenia-buianov,项目名称:all_my_sites,代码行数:31,代码来源:index.php
示例17: f1
echo "----------------- value argument passing of value types ----------------------\n";
function f1($b)
{
echo "\tInside function " . __FUNCTION__ . ", \$b is {$b}\n";
$b = "abc";
echo "After '\$b = \"abc\"', \$b is {$b}\n";
}
$a = 123;
echo "After '\$a = 123', \$a is {$a}\n";
f1($a);
echo "After 'f1(\$a)', \$a is {$a}\n";
f1($a + 2);
// non-lvalue
f1(999);
// non-lvalue
f1(CON);
// non-lvalue
echo "Done\n";
//*/
///*
echo "----------------- byRef argument passing of value types ----------------------\n";
function g1(&$b)
{
echo "\tInside function " . __FUNCTION__ . ", \$b is {$b}\n";
$b = "abc";
echo "After '\$b = \"abc\"', \$b is {$b}\n";
}
$a = 123;
echo "After '\$a = 123', \$a is {$a}\n";
g1($a);
echo "After 'g1(\$a)', \$a is {$a}\n";
开发者ID:jeremyadoux,项目名称:hhvm,代码行数:31,代码来源:memory_model_and_value_types.php
示例18: mysql_query
$img .= '"' . $camp[img] . '",';
$sql_price = mysql_query("SELECT * FROM `price` WHERE `camp`='{$camp['id']}'");
if (mysql_num_rows($sql_price) > 0) {
$tmp1 = "";
$tmp2 = "";
$prices = mysql_fetch_array($sql_price);
do {
$tmp1 .= " " . $prices[price] . " /";
$tmp2 .= " " . $prices[dates] . " /";
} while ($prices = mysql_fetch_array($sql_price));
$tmp1 = mb_substr($tmp1, 1, mb_strlen($tmp1, "UTF-8") - 3, "UTF-8");
$tmp2 = mb_substr($tmp2, 1, mb_strlen($tmp2, "UTF-8") - 3, "UTF-8");
if (f1($avl, $tmp1) !== 'y') {
$avl .= '"' . $tmp1 . '",';
}
if (f1($avl, $tmp2) !== 'y') {
$avl .= '"' . $tmp2 . '",';
}
$price .= '"' . $tmp1 . '",';
$smena .= '"' . $tmp2 . '",';
} else {
$price .= '"",';
$smena .= '"",';
}
} while ($camp = mysql_fetch_array($sql_camp));
$img = mb_substr($img, 0, mb_strlen($img, "UTF-8") - 1, "UTF-8");
$price = mb_substr($price, 0, mb_strlen($price, "UTF-8") - 1, "UTF-8");
$smena = mb_substr($smena, 0, mb_strlen($smena, "UTF-8") - 1, "UTF-8");
$titles = mb_substr($titles, 0, mb_strlen($titles, "UTF-8") - 1, "UTF-8");
$ids = mb_substr($ids, 0, mb_strlen($ids, "UTF-8") - 1, "UTF-8");
?>
开发者ID:jenia-buianov,项目名称:all_my_sites,代码行数:31,代码来源:index.php
示例19: a
{
public static function a($a, $aa)
{
$c = array($aa => $a, 'abcd' => $aa + $a);
witness_dump('abcdefg');
$d = $aa - $a;
return $c;
}
}
function f1($a, $b)
{
$d = c1::a(5, $a + $b);
$a = $a + $d['abcd'];
echo f2($a + $b, $a * $b) . "\n";
}
function f2($a, $b)
{
echo $a * $b . "\n";
return json_encode(c1::a($a, $b));
}
function ff()
{
witness_start('abc');
return 1;
}
echo "abc\n";
ff();
echo f1(5, 6) . "\n";
echo "123\n";
f1(5, 10);
开发者ID:it114,项目名称:witness,代码行数:30,代码来源:005.php
示例20: f1
label2:
echo "At label2 inside function " . __FUNCTION__ . "\n";
if ($p) {
$p = !$p;
goto label2;
// can jump out of a block
}
// goto label1; // can't jump out of a function
goto label3;
label3:
echo "At label3\n";
// label2:; // 'label2' already defined in this scope
label1:
// OK; defined in outer scope
}
f1(TRUE);
labelA:
echo "At labelA\n";
$v = !$v;
if ($v) {
goto labelA;
}
echo "------------------- switch/case labels ---------------------\n";
$a = 10;
$b = 20;
switch ($a) {
case 0:
echo "Case 0 outer\n";
break;
case 10:
echo "Case 10 outer\n";
开发者ID:jeremyadoux,项目名称:hhvm,代码行数:31,代码来源:scope.php
注:本文中的f1函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论