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

1.1     ! misho       1: --TEST--
        !             2: Testing parameter type-hinted with interface
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: namespace foo;
        !             7: 
        !             8: interface foo {
        !             9:        
        !            10: }
        !            11: 
        !            12: class bar {
        !            13:        public function __construct(foo $x = NULL) {
        !            14:                var_dump($x);
        !            15:        }
        !            16: }
        !            17: 
        !            18: class test implements foo {
        !            19:        
        !            20: }
        !            21: 
        !            22: 
        !            23: new bar(new test);
        !            24: new bar(null);
        !            25: new bar(new \stdclass);
        !            26: 
        !            27: ?>
        !            28: --EXPECTF--
        !            29: object(foo\test)#%d (0) {
        !            30: }
        !            31: NULL
        !            32: 
        !            33: Catchable fatal error: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo, instance of stdClass given, called in %s on line %d and defined in %s on line %d

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