Skip to content

Instantly share code, notes, and snippets.

@icambridge icambridge/four.php
Last active Feb 23, 2017

Embed
What would you like to do?
Code Review: Sanity Checks
<?php
$logger = getLogger();
if (($logger instanceof Logger) == false) {
exit(-1);
}
<?php
$people = getNumberOfPeople();
if ($people === null) {
exit(-1);
}
// do numeric logic
<?php
$logger = getLogger();
if ($logger == null) {
exit(-1);
}
<?php
$people = getNumberOfPeople();
if (is_numeric($people) == false) {
exit(-1);
}
// do numeric logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.