View Single Post
Old 02-06-2008, 04:26 PM   #2 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

It makes no sense to write a function exactly like the one you posted, because the function will always return TRUE. However it can be useful to have multiple return points based on different conditions.

PHP Code:
// Useless example
function do_something($with_arg NULL)
{
    if (
$with_arg === NULL)
        return 
FALSE;

    echo 
'Arg is: ';
    
var_dump($arg);
    return 
TRUE;

Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Orc (02-06-2008)