コード例 #1
0
ファイル: FooBarTest.php プロジェクト: rsaugier/ytest
 public function testRewireFunction_user_noRewire()
 {
     $a = null;
     $res = myFunc($a, 53280);
     $this->assertEquals(666, $a);
     $this->assertEquals(888, $res);
 }
コード例 #2
0
<?php

function myFunc($func_name, $name = '����')
{
    $name .= ' ���';
    $func_name($name);
}
function display($welcome)
{
    echo $welcome;
}
myFunc('display', '�Ա�');
コード例 #3
0
<?php

/*
 *欢迎新同学
 *@param1 string $name,新同学的名字
 *@return string $welcome,返回一个欢迎语
 */
function myFunc($name)
{
    $welcome = '欢迎新同学' . $name;
    return $welcome;
}
echo myFunc('啦啦啦');
コード例 #4
0
<?php

function myFunc($c, $l)
{
    echo "how much is that " . $c . " in the window, i do hope that " . $c . "'s" . " for " . $l;
    echo "<br>";
}
myFunc("iguana", "hunting");
//**** Areas of shapes ****
function areaRec($l, $w)
{
    $a = $l * $w;
    echo "A rectangle of length " . $l . " and width " . $w . " has an area of " . $a . " .";
}
function areaTri($b, $h)
{
    $a = 0.5 * $b * $h;
    echo "A triangle of " . $b . " by " . $h . " has an area of " . $a . " .";
}
function areaCir($r)
{
    $a = M_PI * ($r * $r);
    echo "A circle of radius" . $r . " has an area of " . $a . " .";
}
function areaTrap($t, $b, $h)
{
    $a = 0.5 * ($t + $b) * $h;
    echo "A trapezoid of " . $t . " by " . $b . " by " . $h . " has an area of " . $a . " .";
}
function areasDif($x, $y)
{
コード例 #5
0
ファイル: test.php プロジェクト: bbehbudi/phpDeeBuk
    {
    }
    public function c(\phpDeeBuk $dbg)
    {
        $dbg->backtrace();
    }
}
function myFunc(\phpDeeBuk $dbg)
{
    $dbg->backtrace();
}
$dbg = \phpDeeBuk::getInstance();
$a = 1000;
$o = new MyClass();
$o->B = 5979;
$dbg->analyze($a, 'testValue')->analyze($o)->dump($o);
$dbg->setVar(' B  ', 13);
$dbg->setVar('a', 12);
$i1 = $dbg->issetVar('A');
$i2 = $dbg->issetVar('c');
$dbg->writeFormat('%s :: %s', $dbg->issetVar('A'), $dbg->issetVar('c'));
$dbg->dump($dbg->getVarArray());
$dbg->backtrace();
$o->c($dbg);
myFunc($dbg);
$dbg->assertFalse(false);
$dbg->assertTrue(1 == 2, 'My test');
$dbg->renderAndOutput();
?>
</body>
</html><?php 
コード例 #6
0
echo "<hr>";
echo $_SERVER['SERVER_ADDR'];
echo "<hr>";
echo $_SERVER['REQUEST_URI'];
echo "<hr>";
echo $_SERVER['SERVER_SIGNATURE'];
echo "<hr>";
echo $_SERVER['REMOTE_PORT'];
echo "<hr>";
echo $_SERVER['REMOTE_ADDR'];
echo "<hr>";
echo $_SERVER['QUERY_STRING'];
echo "<hr>";
echo PHP_OS;
echo "<hr>";
echo PHP_VERSION;
echo "<hr>";
echo PHP_INT_SIZE;
echo "<hr>";
echo PHP_INT_MAX;
echo "<hr>";
echo __FILE__;
echo "<hr>";
echo __LINE__;
echo "<hr>";
function myFunc()
{
    return __FUNCTION__;
}
$res = myFunc();
echo $res;
コード例 #7
0
ファイル: filters.php プロジェクト: s77com/phpCallback
    // add array element with the name of the function
}
function filter($filterName, $params)
{
    global $filters;
    // Get global filter list
    foreach ($filters[$filterName] as $k => $filterFunction) {
        // Foreach function hooked to original function
        if (is_callable($filterFunction)) {
            // check if hooked function exists
            $params = call_user_func($filterFunction, $params);
            // apply function
        } else {
            echo "Filter \" {$filterFunction} \" not defined! \n";
        }
    }
    return $params;
    // return
}
// This is the core function
function myFunc($input)
{
    $output = $input;
    // Do something
    $output = filter('myFuncFilter', $output);
    // Call filter function for the any filters hooked to myFuncFilter
    return $output;
    // Return
}
echo myFunc($txt);