Let's say we have a class stockFns and I do
$stockFns->{$functionOne}=create_function('$a,$b' , 'return $a+$b;');
This creates a property in $stockFns named whatever create_function returned.
Now I want to refer (invoke) to the created_function.
What would be a clean way to do it in a single instruction?. An example
$stockFns=new StockFns;
$functionOne='add';
$stockFns->{$functionOne}=create_function('$a,$b' , 'return $a+$b;');
//echo "***" . ($stockFns->add)(1,2); // That doesn't work
$theFn=$stockFns->add;
echo $theFn(1,2); // This works but reuires two instructions
Thanks!