What does it mean to “return” yourself at the end of a PHP function?

I am working with a PHP library to generate Excel files, which consists of several functions. This is one of the features:

// Excel begin of file header
function xlsBOF() {
    pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); 
    return;
}

I'm not sure what the return is returned? Can someone clarify this please.

+3
source share
1 answer

This is the same as

return null;

It leaves the function and sets it nullas the return value. In some situations, the operator return;makes it clear that this function returns "nothing" nullinstead of "value" null. Other languages ​​(and documentation) are often used voidfor this.

+7
source

All Articles