Skip to content

Instantly share code, notes, and snippets.

@stormwild
Created June 22, 2013 10:50
Show Gist options
  • Select an option

  • Save stormwild/5840423 to your computer and use it in GitHub Desktop.

Select an option

Save stormwild/5840423 to your computer and use it in GitHub Desktop.
// http://net.tutsplus.com/tutorials/php/from-procedural-to-object-oriented-php/
// http://us3.php.net/manual/en/functions.variable-functions.php
function foo() {
echo "This is foo";
}
function bar($param) {
echo "This is bar saying: $param";
}
$function = 'foo';
$function(); // Goes into foo()
$function = 'bar';
$function('test'); // Goes into bar()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment