lang/php/ VariableVariableNames


<?php
class A {
  function __construct() {
    $this->a = "hello";
  }
}
function f() {
  echo "boo\n";
}
$a = new A();
$c = "b";
$a->$c = "mrflibble";
$x = "a";
echo $a->$x; # prints "hello"
echo "\n";
echo $a->b; # prints "mrflibble"
echo "\n";
$fx = "f";
$fx(); # prints "boo"