Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

php: rfc: closures (via) I never thought I’d see the day, but a patch adding closures to PHP has been both proposed and accepted! Looks like a solid implementation—the syntax is similar to JavaScript but makes explicit which variables are to be captured. As with much of PHP, values are copied in to the closure by default but you can use an ampersand to specify JavaScript-style pass-by-reference instead.

Tagged , , ,

2 comments

  1. Now if they'd just add the Traits patch...

    Charles - 21st July 2008 19:41 - #

  2. I'd like to be greedy and ask for one more thing: the ability to pass a function by name as a callback. It feels dirty to pass function names as strings.

    Richard Crowley - 22nd July 2008 01:26 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site