예제 #1
0
function notARelay4($a)
{
    return someClass::methodRelay($a + 1);
}
 function testExecute()
 {
     $array = [1, 3, 5];
     $f = new Functional($array);
     $callback = function ($f = NULL) {
         static $i = 0;
         if ($i === 0 && !is_a($f, 'Letharion\\Functional\\Functional')) {
             throw new \Exception('Self not passed as argument');
         }
         $i++;
         return $i;
     };
     $result = $f->filter($this->noop)->execute($callback)->filter($this->noop);
     $this->assertEquals($callback(), 2);
     $object = new someClass();
     $result = $f->filter($this->noop)->execute(array($object, 'someMethod'))->filter($this->noop);
     $this->assertEquals($object->someMethod(), 2);
 }
예제 #3
0
0000735 need support for returning a value from a function by reference

<?php 
class someClass
{
    var $zot = 6;
    function someClass()
    {
        $this->zot = 2;
    }
    function &test()
    {
        $a =& new someClass();
        return $a;
    }
}
$b = someClass::test();
echo $b->zot;
?>

예제 #4
0
<?php

substr($token[1], 1, -1);
$s->substr($token[1][2][3], 0, -1);
someClass::substr($token[1][2][3][4], 0, -1);
someClass::substr();
substr($token[1][2], 0, -1);