Skip to content

Instantly share code, notes, and snippets.

@m3m0r7
Last active November 28, 2018 15:36
Show Gist options
  • Save m3m0r7/2207d133c8de40a9b7be724d99a60596 to your computer and use it in GitHub Desktop.
Save m3m0r7/2207d133c8de40a9b7be724d99a60596 to your computer and use it in GitHub Desktop.
<?php function z($_,$p){return array_filter($_,function($v)use($p){return$v%$p==0;});}function x(&$_,$p){array_walk($_,function(&$v)use($p){$v=$p;});}$y=@array_keys;$a=array_combine($a=$y(array_fill(1,100,0)),$a);$b=z($a,3);$c=z($a,5);$d=array_intersect($b,$c);x($b,@Fizz);x($c,@Buzz);x($d,@FizzBuzz);$f=$d+$c+$b+$a;ksort($f);echo join("\n",$f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment