A string identical to the name of the sayHello() function is assigned to the $function_holder variable on line 10. Once this is done, we can use this variable in conjunction with parentheses to call the sayHello() function. We do this on line 11.

Put these lines into a text file called sayhello.php, and place this file in your Web server document root. When you access this script through your Web browser, it produces the following:

hello

Why would we want to do this? In the example, we simply make more work for ourselves by assigning the string "sayHello" to $function_holder. Dynamic function calls are useful when you want to alter program flow according to changing circumstances. We might want our script to behave differently according to a parameter set in a URL's query string, for example. We can extract the value of this parameter and use it to call one of a number of functions.