Bubble Foundry

Posts tagged with: closures

Because I love making stupid little libraries I’m proud to present CAP, “CAP is an experiment is stateful PHP form handling.” As you can see, closures are bound to form elements. Pretty cool, no? PHP 5.3+ only. Read more – ‘CAP’.
PHP Closures
PHP 5.3 has added support for true anonymous functions and closures. Unfortunately, there are a few gotchas. The main one is that no variables are automatically enclosed: you must specify the variables you want to enclose. So, this will cause an exception: $a = 2; $f = function($i) { return $i + $a; } $f(1); […] Read more – ‘PHP Closures’.