I would like to do something like this:
echo $myObject->value_$id but I don't know proper syntax and I'm not sure if it is possible.
$id is some PHP variable, for example has value 1. In the end, I would like to get $myObject->value_1 but the number part (1) should be dynamic.
->$myObject->myArray["element"];or$myObject->myArray[$id];. I think using arrays is a better way to do this anyways. But, what exactly do you want to do?