update : 2015.11.03
php.shukuma.com검색:
|
Defining namespaces(PHP 5 >= 5.3.0) Although any valid PHP code can be contained within a namespace, only the following types of code are affected by namespaces: classes (including abstracts and traits), interfaces, functions and constants. Namespaces are declared using the namespace keyword. A file containing a namespace must declare the namespace at the top of the file before any other code - with one exception: the declare keyword. Example #1 Declaring a single namespace
<?php Example #2 Declaring a single namespace
<html> In addition, unlike any other PHP construct, the same namespace may be defined in multiple files, allowing splitting up of a namespace's contents across the filesystem. |