Skip to content

Instantly share code, notes, and snippets.

@phawk
Created January 14, 2012 12:01
Show Gist options
  • Save phawk/1611175 to your computer and use it in GitHub Desktop.
Save phawk/1611175 to your computer and use it in GitHub Desktop.
A quick example of a recursive closure in PHP, passing itself into the scope by reference.
<?php
$closure = function ($params) use (&amp;$closure) {
// ...
$closure($params);
}
// Start the magics
$closure($params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment