Redirecting to another page class Redirect {

    public function __construct() {
    }

    public function to($key, $page) {
        if(isset($page) &amp;&amp; !empty($page)) {
            header('Location: ?' . $key . '=' . $page);
            exit();
        }
    }

}


With this class I can use this:

$foo-&gt;redirect('page', 'home'); 


instead of this:

header('Location: ?page=home);
Well, for starters, your redirect will never work if you pass in both $key and $page, as you're asking for the following:

1. is not isset($page)
2. is not empty($page)


Which means that the redirect will happen only when $page is NOT set and NOT empty. Because empty() calls isset() internally, you should only need this:

if(!empty($page))


Additionally, you're not managing your buffers. Ideally, you should use the ob_ functions as well as headers_sent() to check if headers have already been sent. If you don't manage your buffer, you're very likely to hit the infamous "Cannot modify header information - headers already sent" error. This post goes into further detail on how to fix that error, especially using the ob_ functions. 

Aside from all that, your construct is doing nothing. If your Redirect class only has the to() method, perhaps you're better off making it a standalone function, or adding additional functionality.