Skip to content

Instantly share code, notes, and snippets.

@itsjavi
Created January 15, 2013 17:49
Show Gist options
  • Select an option

  • Save itsjavi/4540458 to your computer and use it in GitHub Desktop.

Select an option

Save itsjavi/4540458 to your computer and use it in GitHub Desktop.
Get PHP closure function parameter names
<?php
function get_closure_params(\Closure $fn){
preg_match_all('/\[\$(.+)\]/', print_r($fn, true), $matches);
return isset($matches[1]) ? $matches[1] : array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment