Last active
March 28, 2019 07:15
-
-
Save zonuexe/6da5ad0aa5a67acd310794ed79df9c39 to your computer and use it in GitHub Desktop.
$-less PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
const X = 100; | |
const FB = ['FizzBuzz', null, null, 'Fizz', null, 'Buzz', 'Fizz', | |
null, null, 'Fizz', 'Buzz', null, 'Fizz', null, null]; | |
call_user_func(new class { | |
function __invoke() | |
{ | |
if (X-count(debug_backtrace())-1) call_user_func(__METHOD__); | |
echo FB[(X-count(debug_backtrace())) % 15] ?? X-count(debug_backtrace()), PHP_EOL; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
const FB = ['FizzBuzz', null, null, 'Fizz', null, 'Buzz', 'Fizz', null, null, 'Fizz', 'Buzz', null, 'Fizz', null, null]; | |
call_user_func(new class { | |
function __invoke() | |
{ | |
if (func_get_arg(0) -1 ) call_user_func(__METHOD__, func_get_arg(0) - 1); | |
echo FB[func_get_arg(0) % 15] ?? func_get_arg(0), PHP_EOL; | |
} | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment