Archive for June 19th, 2008

Pretending PHP doesn’t suck

<?php // Perhaps the simplest practical use of a fold? // // (While this is fairly consise (even in PHP) it calculates the length of a // string 2n-2 times [which is n-2 times more than needed]) function getLongestWord($words) {   $fun = create_function(’$a,$b’, ‘return (strlen($a) > strlen($b)) ? $a : $b;’);   return array_reduce($words, [...]

Posted by Matthew on June 19th, 2008

Filed under Uncategorized | No Comments »