Skip to content

Instantly share code, notes, and snippets.

@cwhite92
Created November 19, 2015 12:17
Show Gist options
  • Save cwhite92/a1adc0b3fcdd2559b886 to your computer and use it in GitHub Desktop.
Save cwhite92/a1adc0b3fcdd2559b886 to your computer and use it in GitHub Desktop.
PHP golf
<?php $b=99;$d=" bottles of beer";$c="$d on the wall";$f="file";do{echo "$b$c, $b$d.\n";if(!--$b){echo $f('http://is.gd/sKW90b')[0];$b=99;}else echo $f('http://is.gd/2m5PYo')[0];echo ", $b$c.\n\n";}while($b<99);
<?php
$b=99;
$d=" bottles of beer";
$c="$d on the wall";
$f="file";
do{
echo "$b$c, $b$d.\n";
if(!--$b){
echo $f('http://is.gd/sKW90b')[0];$b=99;
}
else echo $f('http://is.gd/2m5PYo')[0];
echo ", $b$c.\n\n";
}while($b<99);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment