Skip to content

Instantly share code, notes, and snippets.

@WPDC
Created December 13, 2015 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WPDC/74a377edafc3cd5b4d58 to your computer and use it in GitHub Desktop.
Save WPDC/74a377edafc3cd5b4d58 to your computer and use it in GitHub Desktop.
CS0110 3.1 - Variables in Action
// $unitsSold has the data from the database
$totalUnitsSoldInQ4 => array(
2014 => $unitsSold[2014][10] + $unitsSold[2014][11],
2015 => $unitsSold[2015][10] + $unitsSold[2015][11],
);
if ( $totalUnitsSoldInQ4[2015] < $totalUnitsSoldInQ4[2014] ) {
printReport();
}
if ( ( 98180 + 79436 ) < ( 128039 + 90512 ) ) {
printReport();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment