Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Which one do you choose?

#Christmas Tree

<?php 
    if($a) {
        if($b) {
            if($c) {
                if($d) {
                    // This is what I really want to do
                } else {
                    //Do something something else
                }
            } else {
                //Do something else
            }
        } else {
            // Do something
        }
    } else {
        //Do something
    }
    return; //blah blah
?>

#Return

 <?php
    if(!$a){
        //do something
        return;
    }
    if(!$b) {
        //do something
        return;
    }
    if(!$c) {
        //Do something else
        return;
    }
    if(!$d) {
        //Do something something else
        return;
    }
    // This is what I really want to do
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment