Return to ns_057.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests |
1.1 ! misho 1: --TEST-- ! 2: 057: Usage of 'namespace' in compound names (inside namespace) ! 3: --FILE-- ! 4: <?php ! 5: namespace Test\ns1; ! 6: ! 7: const C = "const ok\n"; ! 8: ! 9: function foo() { ! 10: return "func ok\n"; ! 11: } ! 12: ! 13: class foo { ! 14: const C = "const ok\n"; ! 15: const C2 = namespace\C; ! 16: static $var = "var ok\n"; ! 17: function __construct() { ! 18: echo "class ok\n"; ! 19: } ! 20: static function bar() { ! 21: return "method ok\n"; ! 22: } ! 23: } ! 24: ! 25: function f1($x=namespace\C) { ! 26: return $x; ! 27: } ! 28: function f2($x=namespace\foo::C) { ! 29: return $x; ! 30: } ! 31: ! 32: function f3(namespace\foo $x) { ! 33: return "ok\n"; ! 34: } ! 35: ! 36: echo namespace\C; ! 37: echo namespace\foo(); ! 38: echo namespace\foo::C; ! 39: echo namespace\foo::C2; ! 40: echo namespace\foo::$var; ! 41: echo namespace\foo::bar(); ! 42: echo namespace\f1(); ! 43: echo namespace\f2(); ! 44: echo namespace\f3(new namespace\foo()); ! 45: echo namespace\unknown; ! 46: ?> ! 47: --EXPECTF-- ! 48: const ok ! 49: func ok ! 50: const ok ! 51: const ok ! 52: var ok ! 53: method ok ! 54: const ok ! 55: const ok ! 56: class ok ! 57: ok ! 58: ! 59: Fatal error: Undefined constant 'Test\ns1\unknown' in %sns_057.php on line %d