Eval a {FIELD} in scriptcase

I have executed following code
$fieldName = “name_first”;
$cmd = “$this->{” . $fieldName . “}=‘override name’;”;
eval($cmd);

which is equavalent to
{name_first} = ‘override name’;

while executed my code, it manage to UPDATED my page’s first name field value to ‘override name’
But problem is, it generate an error code saying name_first is not recognize

how to resolve it?

my objective is to put the {field_name} as a value, and execute it via eval