Annotation of embedaddon/php/Zend/tests/bug42802.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #42802 (Namespace not supported in typehints)
                      3: --FILE--
                      4: <?php
                      5: namespace foo;
                      6: 
                      7: class bar {
                      8: }
                      9: 
                     10: function test1(bar $bar) {
                     11:        echo "ok\n";
                     12: }
                     13: 
                     14: function test2(\foo\bar $bar) {
                     15:         echo "ok\n";
                     16: }
                     17: function test3(\foo\bar $bar) {
                     18:         echo "ok\n";
                     19: }
                     20: function test4(\Exception $e) {
                     21:        echo "ok\n";
                     22: }
                     23: function test5(\bar $bar) {
                     24:         echo "bug\n";
                     25: }
                     26: 
                     27: $x = new bar();
                     28: $y = new \Exception();
                     29: test1($x);
                     30: test2($x);
                     31: test3($x);
                     32: test4($y);
                     33: test5($x);
                     34: --EXPECTF--
                     35: ok
                     36: ok
                     37: ok
                     38: ok
                     39: 
                     40: Catchable fatal error: Argument 1 passed to foo\test5() must be an instance of bar, instance of foo\bar given, called in %sbug42802.php on line %d and defined in %sbug42802.php on line %d

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