Join Kevin Skoglund for an in-depth discussion in this video Grouped imports with use(), part of PHP 7 New Features.
- If you're using PHP's namespacing feature, then you…might want to make use of the new Grouped Imports…that PHP gives us when we call use().…First let's get a quick review on how use() works normally.…Let's say that we have a file called constants.php…and in that file we declare a namespace at the top.…So App\Library\Costants, and then I'm going to…go ahead and define a couple of constants inside that file.…Okay, so that's one file.…In a second file, I'm going to require that file and then…I'm going to tell it that I'm want to use that namespace…by calling use, use and then the name of the namespace…I want to use.…
That then allows me to call echo App\Library\Constants\…APP_NAME and I can get back that value…because I'm using that namespace.…In addition to that, we also have the ability…to provide aliases to namespaces.…So I can call use App\Library\Constants as C and now…I can not only call it the long way by writing it all out,…I also have a shortcut available to me, an alias,…which is echo C\APP_NAME and I get back…
- Scalar type and return type declarations
- New operators in PHP 7
- Anonymous classes
- Arrays as constants
- Catchable exceptions and errors
- Integer division with intdiv()
- Deprecations and deletions
Skill Level Intermediate
1. Major Features
3. Deprecations and Deletions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.