PHP 8.5.0 Alpha 4 available for testing

Voting

: max(three, five)?
(Example: nine)

The Note You're Voting On

dominic_mayers at yahoo dot com
8 years ago
The keyword "use" has been recycled for three distinct applications:
1- to import/alias classes, traits, constants, etc. in namespaces,
2- to insert traits in classes,
3- to inherit variables in closures.
This page is only about the first application: importing/aliasing. Traits can be inserted in classes, but this is different from importing a trait in a namespace, which cannot be done in a block scope, as pointed out in example 5. This can be confusing, especially since all searches for the keyword "use" are directed to the documentation here on importing/aliasing.

<< Back to user notes page

To Top