News for hackers. Stuff that matters.
Re:Refactored PHP engine makes Wordpress 20% faster by porker on Tuesday May 06, 2014 @05:10AM (#7703417)
> can just be this in Python:

In PHP 5.3+ you can write:

    $image_urls = array_map(function($image) {return 'illos/'. $image['url'];}, $images);
Not as concise, but I'd postulate easier to read for people not familiar with list comprehensions.

In PHP 5.5+ there may be another way, but we're stuck with 5.3 in production for most clients, so I'm not up to speed.

> And, closures in Python -- and to be fair, just about any language that isn't PHP -- close over variables in the scope they're defined automatically, without having to use PHP's strange "use ($a, $b, $c)" construct.

Mmm, the debate of explicit or implicit scope? Explicit at least gets round those strange errors (hello Javascript) where you think you're referencing one thing... and actually referencing something else.

Re:Refactored PHP engine makes Wordpress 20% faster by sumzup on Tuesday May 06, 2014 @11:20AM (#7704985)
You can't write production Python and be unfamiliar with list comprehensions. They're a fundamental part of the language.
Re:Refactored PHP engine makes Wordpress 20% faster by philjohn on Tuesday May 06, 2014 @07:08AM (#7703706)
this

(javascript pun intended)