I tried submitting an entry to the 99 bottles challenge where I was doing the following: $t="bottles of beer"; [...] while($i) { [...] $i-1?$t{6}="s":$t{6}=""; [...] } now when run it in the terminal on my mac (php 4.4.4) whenever it gets to "bottle" in the singular, it follows with only 1 space, but when I submit it to CodeGolf, there are always 2 spaces following "bottle" in the singular.
Any thoughts? Is this due to code golf running a newer version of php?
Yeah, Code Golf is running PHP 5.2.x, so it is a newer version. I am unaware of any differences between PHP4 and PHP5 that would cause this, but obviously I can't be certain about that without seeing the rest of your code. If you want, you can send it to me (Email using the contact link at the bottom of the page) and I'll try and identify whether it's us or you at fault!
$t="bottles of beer";[...]
while($i) {
[...]
$i-1?$t{6}="s":$t{6}="";
[...]
}
now when run it in the terminal on my mac (php 4.4.4) whenever it gets to "bottle" in the singular, it follows with only 1 space, but when I submit it to CodeGolf, there are always 2 spaces following "bottle" in the singular.
Any thoughts? Is this due to code golf running a newer version of php?