PHP 7 use Statement

In Older PHP version (PHP 5 >= 5.3.0), if we want to import Classes,constants and functions from the same namespace then we have to use the "use" statement multiple times to import each of these elements. But From PHP7 onwards, A single use statement can be used to import Classes, functions and constants from same namespace .


// Before PHP 7
   use com\tutsway\ClassAM;
   use com\tutsway\ClassBM;
   use com\tutsway\ClassCM as C;

   use function com\tutsway\fn_a;
   use function com\tutsway\fn_b;
   use function com\tutsway\fn_c;

   use const com\tutsway\ConstA;
   use const com\tutsway\ConstB;
   use const com\tutsway\ConstC;

   // PHP 7+ code
   use com\tutsway\{ClassAM, ClassBM, ClassCM as C};
   use function com\tutsway\{fn_a, fn_b, fn_c};
   use const com\tutsway\{ConstA, ConstB, ConstC};