Which statement correctly describes the scope of variables defined within a closure using the ‘use’ keyword?

PHP Intermediate Hard

PHP Intermediate — Hard

Which statement correctly describes the scope of variables defined within a closure using the ‘use’ keyword?

Key points

  • Closures do not automatically inherit parent scope variables.
  • The 'use' keyword imports variables from the parent scope.
  • Default inheritance is by value, not by reference.

Ready to go further?

Related questions