Switch statement in PHP - cleaner way to determine priority?
That's certainly a bastardization of the switch statement.

What you should use is an if...else if... group:

$response = null; //initialize
if ( $controller-&gt;using_router)
{
  $response = $controller-&gt;router();
}
else
{
  $response = Annotation\Runner::run(Annotation\Extractor::extract( $controller, $method ) );
  if ( is_null( $response )
  {
    $response = call_user_func_array( array( $controller, $method ), $parameters );
  }
}


Note: this code flows in a readable manner. The response is set, if the controller is using the router, the response is set to the output of $controller-&gt;router(), otherwise the response is set to the extracted controller method.

If that is null, the response is finally set to whatever $controller-&gt;$method(...) produces.

Code should always flow in a readable manner (unless it's minified, obfuscated, or encoded).