Ejemplo n.º 1
0
<?php

class test
{
    public function method()
    {
        return ArrayIterator::current();
    }
}
$test = new test();
$test->method();
echo "Done\n";
Ejemplo n.º 2
0
        $doc = $rm->getDocComment();
        $result = preg_match('/\\@before\\((.*)\\)/siU', $doc, $match);
        if ($result === 0 or $result === false) {
            return null;
        }
        return $match[1];
    }
}
class test extends base
{
    /**
     * @before(before)
     */
    public function _method()
    {
        echo __METHOD__ . " called\n";
    }
    public function before()
    {
        echo __METHOD__ . " called\n";
    }
    public function _method2()
    {
        echo __METHOD__ . " called\n";
    }
}
//end
$obj = new test();
$obj->method();
$obj->method();
$obj->method2();