php use means that you can use a use in PHP to import classes, functions and constants from the same namespace. The usage statement is "use some\namespace\ClassA; use some\namespace\ClassB;".
PHP 7use statement
PHP 7 can be used A use imports classes, functions and constants from the same namespace:
Example
// PHP 7 之前版本需要使用多次 use use some\namespace\ClassA; use some\namespace\ClassB; use some\namespace\ClassC as C; use function some\namespace\fn_a; use function some\namespace\fn_b; use function some\namespace\fn_c; use const some\namespace\ConstA; use const some\namespace\ConstB; use const some\namespace\ConstC; // PHP 7+ 之后版本可以使用一个 use 导入同一个 namespace 的类 use some\namespace\{ClassA, ClassB, ClassC as C}; use function some\namespace\{fn_a, fn_b, fn_c}; use const some\namespace\{ConstA, ConstB, ConstC}; ?>
The above is the detailed content of What is the usage of php7 use. For more information, please follow other related articles on the PHP Chinese website!