Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> (In fact the latest version of PHP (5.3) can, but for years PHP has been lacking this, so the point stands.)

Actually, it's been able to do that for a LONG time. Pretty sure (99.9% sure here) you could do that in PHP 4, and probably in PHP 3 as well (but really, it's been so long, forgive me for not remembering). Different syntax, of course, but yeah, you could do that.

PHP 5.3 essentially just made it more explicit.

Edit: When I say different syntax, I mean slightly different syntax, obvious, because it's Python being reference. The end result, however, is the same.

And, if I may be so bold, the PHP way prior to PHP 5.3 (though still supported), encouraged a cleaner implementation then the 'Cook' example demonstrated in the link above.



Well, I guess I'm asking for trouble arguing against a language I have no development experience in.

A quick Google search shows that PHP 5.2 and earlier seem to support something like the anonymous functions required in the example I linked to above -- via the create_function method. But using it in practice appears to be full of ifs, buts and complexities: http://nz.php.net/manual/en/function.create-function.php#706...

But maybe one could get it work if used with care.

If I were ever chained to a desk and forced to work with a PHP framework like Drupal that does not yet support v5.3, I'd look in to this.

Otherwise I'd choose a language that cares more for concepts like readable code and deep modularity.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: