xref: /Universal-ctags/Units/parser-php.r/php-namespaces.d/input.php (revision 6bf29d9ecad33a951778114bd6e55416fe8eb604)
1Tests for namespaces (braced version)
2
3Expected output is
4
5namespaces:
6	Bar\Baz
7	Foo
8
9classes:
10	B [Bar\Baz]
11	C [Foo]
12
13functions:
14	__construct [Foo\C]
15	__construct [Bar\Baz\B]
16	a [Foo]
17	a [Bar\Baz]
18	b [Foo]
19	c [Bar\Baz\B]
20	d [Foo\C]
21	inRoot
22	meToo
23
24<?php
25
26/* namespace "Foo" */
27namespace Foo {
28	function a() {
29		return true;
30	}
31
32	function b() {
33		return false;
34	}
35
36	class C {
37		function __construct() {
38			// ...
39		}
40
41		function d() {
42			return 42;
43		}
44	}
45}
46
47/* namespace "Bar\Baz" */
48namespace Bar\Baz {
49	function a() {
50		return true;
51	}
52
53	class B {
54		function __construct() {
55			// ...
56		}
57
58		function c() {
59			return 42;
60		}
61	}
62}
63
64/* back to root namespace */
65namespace {
66	function inRoot() {
67		return true;
68	}
69
70	function meToo() {
71		return true;
72	}
73}
74