Annotation of embedaddon/php/Zend/tests/indirect_call_array_004.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Indirect method call by array - Testing exception and method magics
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: class foo {
        !             7:        static public function abc() {
        !             8:                throw new Exception('foo');
        !             9:        }
        !            10:        public function __call($a, $b) {
        !            11:                printf("From %s:\n", __METHOD__);
        !            12:                throw new Exception($a);
        !            13:        }
        !            14:        static public function __callStatic($a, $b) {
        !            15:                printf("From %s:\n", __METHOD__);
        !            16:                throw new Exception($a);
        !            17:        }
        !            18: }
        !            19: 
        !            20: 
        !            21: $arr = array('foo', 'abc');
        !            22: 
        !            23: try {
        !            24:        $arr();
        !            25: }
        !            26: catch (Exception $e) {
        !            27:        echo $e->getMessage(), "\n";
        !            28: }
        !            29: 
        !            30: $arr = array('foo', '123');
        !            31: 
        !            32: try {
        !            33:        $arr();
        !            34: }
        !            35: catch (Exception $e) {
        !            36:        echo $e->getMessage(), "\n";
        !            37: }
        !            38: 
        !            39: 
        !            40: echo "------\n";
        !            41: 
        !            42: $foo = new foo;
        !            43: $arr = array($foo, 'abc');
        !            44: 
        !            45: try {
        !            46:        $arr();
        !            47: }
        !            48: catch (Exception $e) {
        !            49:        echo $e->getMessage(), "\n";
        !            50: }
        !            51: 
        !            52: 
        !            53: $foo = new foo;
        !            54: $arr = array($foo, '123');
        !            55: 
        !            56: try {
        !            57:        $arr();
        !            58: }
        !            59: catch (Exception $e) {
        !            60:        echo $e->getMessage(), "\n";
        !            61: }
        !            62: 
        !            63: ?>
        !            64: --EXPECTF--
        !            65: foo
        !            66: From foo::__callStatic:
        !            67: 123
        !            68: ------
        !            69: foo
        !            70: From foo::__call:
        !            71: 123

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>