1
2<?php
3namespace m\name; // see "Defining Namespaces" section
4
5class MyClass {}
6function myfunction() {}
7const MYCONST = 1;
8
9$a = new MyClass;
10$c = new \my\name\MyClass; // see "Global Space" section
11
12$a = strlen('hi'); // see "Using namespaces: fallback to global
13 // function/constant" section
14
15$d = namespace\MYCONST; // see "namespace operator and __NAMESPACE__
16 // constant" section
17$d = __NAMESPACE__ . '\MYCONST';
18echo constant($d); // see "Namespaces and dynamic language features" section
19?>
20
21