In this tutorial we're going to investigate how we can improve our code by cleaning up unnecessary code by using shorthand code samples in PHP. So what do I mean by removing unnecessary code? The most common situation where you see unnecessary code is in the use of if statements which will force a return.
function ifStatementReturn($value) { if($value) { return 'this value is true'; } return 'this value is false'; } That's cleaner already but we can do more to clean up this code.