How do variable functions in PHP work?

function, php

Solution

It means you can’t do something like this:

$var = "echo";
$var "Hello World!";

Problem

In php.net the following is written: Variable functions won't work with language constructs such as echo, print, unset(), isset(), empty(), include, require and the like. Utilize wrapper functions to make use of any of these constructs as variable functions. source What does that mean? Could anyone give examples because I’ve tried using the variable function in an echo and it worked perfectly: ``` function city() { return "new york"; } $var = "city"; echo "city: " . $var(); ```

Original source