PHP 7 Tutorial
PHP 7 Useful Resources
Selected Reading
- PHP 7 - Removed Extensions & SAPIs
- PHP 7 - Deprecated Features
- PHP 7 - Session Options
- PHP 7 - Integer Division
- PHP 7 - Error Handling
- PHP 7 - use Statement
- PHP 7 - Expectations
- PHP 7 - CSPRNG
- PHP 7 - IntlChar
- PHP 7 - Filtered unserialize()
- PHP 7 - Closure::call()
- PHP 7 - Anonymous Classes
- PHP 7 - Constant Arrays
- PHP 7 - Spaceship Operator
- PHP 7 - Null Coalescing Operator
- PHP 7 - Return Type Declarations
- PHP 7 - Scalar Type Declarations
- PHP 7 - Environment Setup
- PHP 7 - Performance
- PHP 7 - Introduction
- PHP 7 - Home
PHP 7 Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
PHP 7 - use Statement
PHP 7 - use Statement
From PHP7 onwards, a single use statement can be used to import Classes, functions and constants from same namespace instead of multiple use statements.
Example
<?php // Before PHP 7 use com utorialspointClassA; use com utorialspointClassB; use com utorialspointClassC as C; use function com utorialspointfn_a; use function com utorialspointfn_b; use function com utorialspointfn_c; use const com utorialspointConstA; use const com utorialspointConstB; use const com utorialspointConstC; // PHP 7+ code use com utorialspoint{ClassA, ClassB, ClassC as C}; use function com utorialspoint{fn_a, fn_b, fn_c}; use const com utorialspoint{ConstA, ConstB, ConstC}; ?>Advertisements