Home > Article > Backend Development > PHP's new feature use enhances usage
This article mainly shares with you the enhanced use of PHP's new feature use. Classes, functions and constants imported from the same namespace can now be imported at once through a single use statement.
<?php// PHP 7 之前版本用法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 some\namespace\{ClassA, ClassB, ClassC as C}; use function some\namespace\{fn_a, fn_b, fn_c}; use const some\namespace\{ConstA, ConstB, ConstC}; ?>
Related recommendations:
Javascript tutorial use strict strict mode detailed explanation
How to use the use function in SeaJS
Javascript tutorial use strict strict mode detailed explanation
The above is the detailed content of PHP's new feature use enhances usage. For more information, please follow other related articles on the PHP Chinese website!