How can the execution of a function be prematurely terminated in PHP?
In PHP, you can prematurely terminate the execution of a function by using the `return` statement. When `return` is called within a function, it immediately exits the function and returns the specified value. This can be useful for stopping the execution of a function if a certain condition is met or if you want to return a value early.
function checkValue($value) {
if ($value < 0) {
return "Value cannot be negative";
}
// Continue with the function
}