scotfl.ca

PHP 5.3: Now With 40% Less Ugh!

C’est functional programming:

array_walk($line, function (&$i) { $i = trim($i); });

Or, at least, close enough. Either way, a vast improvement over the old method.

Also nifty: the ternary shortcut: ($a ?: $b) is just like ($a ? $a : $b), but without the double evaluation.

It’s a nice little update.

This entry was posted on 27 September 2009 at 15:57 and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.