Yeah, I would never hire someone using dynamic variables, any occurrence of "$$" is a no-no and just denotes poor engineering.
$x=0;$a='x';$b='a'; echo $$$b; $x = 'y';
$y = 'x';
echo $$$$$$$$$$$$$y;
I've tested with 1500 `$` and it still works :) foreach(['a' => closureA, 'b' => closureB, 'c' => closureC] as $name => $toApply) {
$myObject->${convertNameToFieldName($name)} = $toApply($something);
}I hate stuff like that. It breaks more than it helps. It overcomplicates trying to dance your way through reasoning what is actually happening. It’s unreliable and I hate it.
Carry on...