What is the significance of using 'use' keyword in anonymous functions in PHP?
When using anonymous functions in PHP, the 'use' keyword is used to bring variables from the parent scope into the anonymous function's scope. This is important when you need to access variables defined outside of the anonymous function within its body. Without using the 'use' keyword, the anonymous function would not have access to these external variables.
$externalVariable = 10;
$anonymousFunction = function() use ($externalVariable) {
echo $externalVariable;
};
$anonymousFunction(); // Output: 10