This contest could be fun. It appears that Paul "PHP" Reinheimer is semi-disposed of so we won't have the full settings of PHP yet, but depending on what's turned on, we could get some very interesting results.
I threw together a couple of variations of a solutions this afternoon and testing them out with Domain51_MicroBench. Seems foreach has had some tuning of how it handles temporary variables since the last time I benchmarked it. I also found out how little PHP cares about whitespace. I've got my current solution down to 130 bytes, with another 3 I could drop if they allow short tags.
Of course, I could cut that by quite a few more depending on the config ;-)
7 comments
But, since I don't really know what exactly the items they are going to use to test the script... so I might actually not able to parse some of them.
My code now looks like Perl though :(
But I will not make this mistake again, my apologies.
I also did a "perl-like" version with the same parsing algorithm but using array_map and array_filter (but unfortunately he preg functions don't return the matches so it's not quite lisp-like) but it was 463 chars.
