this is an effect of comma operator, i.e the last element is the one that is used as the value.
a+=(a+=3,5,a)
this expression evaluates a+=3 first which makes a = 4 , this result gets discarded then evaluates 5 which is also discarded and then evaluates a which is the last element so the result we get is
a+=4
which gives 8 as the output