Skip to content

Instantly share code, notes, and snippets.

@crynobone
Last active December 16, 2015 10:08
Show Gist options
  • Select an option

  • Save crynobone/5417514 to your computer and use it in GitHub Desktop.

Select an option

Save crynobone/5417514 to your computer and use it in GitHub Desktop.
<?php
function inception($iterator = 1, $range = 0, $limit = 15, $goDeeper = true) {
while ($iterator < $limit) {
echo ($range += $iterator)%10;
$goDeeper and inception($iterator, $range, ($limit - 1), false);
++$iterator;
}
print PHP_EOL;
};
inception();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment