Jump to content

[SOLVED] return statement


db_programmer

Recommended Posts

I have been writing some PHP code, and I just recently realized that I have not been including a return statement in my functions that do not return any values.  This hasn't seemed to affect my functionality at all.

 

EXAMPLE:

function my_function($blah)
{
    //Do this
    //Do this
    //Do this
}

 

instead of

function my_function($blah)
{
    //Do this
    //Do this
    //Do this
    return;
}

 

I just wanted to know whether it made any difference one way or the other whether I include

return;

at the end of each function, or if it is unnecessary as it seems.

 

Thanks,

dbp

Link to comment
https://forums.phpfreaks.com/topic/165196-solved-return-statement/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.