Skip to content

Instantly share code, notes, and snippets.

@thedineshj
Last active November 27, 2018 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedineshj/fd9bde7c4d0e2c25c2c95c4c624b0776 to your computer and use it in GitHub Desktop.
Save thedineshj/fd9bde7c4d0e2c25c2c95c4c624b0776 to your computer and use it in GitHub Desktop.
Calling a PHP function, which has the same name as whatever the variable evaluates to
<?php
function doubleIt($num){
echo 2*$num;
}
$functionName="doubleIt";
$functionName(7); // 14
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment