コード例 #1
0
ファイル: test119.php プロジェクト: dw4dev/Phalanger
[expect php]

[file]
<?php 
class c
{
    var $x;
    function c($y)
    {
        $x = $y;
    }
    function foo()
    {
        echo $this->x;
    }
}
$a = new c(2);
$a->foo();
function &returns_reference(&$x)
{
    $x->foo();
    $x->x = 5;
    return $x;
}
$newref =& returns_reference($a);
$newref->foo();
コード例 #2
0
ファイル: 730.php プロジェクト: badlamer/hhvm
function z()
{
    $p = new c();
    $p->foo(meh());
    $p = null;
}