If A'B = BA, is A symmetric?

When A'B = BA and A is a squared matrix and B is not a zero matrix, can we say A is always symmetric?

I'm using ARPACK which is a famous eigenvalue solver software, the DSAUPD function of ARPACK says

c. This method has been designed to compute approximations to a 
c  few eigenpairs of a linear operator OP that is real and symmetric 
c  with respect to a real positive semi-definite symmetric matrix B, 
c  i.e.
c                   
c       B*OP = (OP')*B.  

The reason why I'm asking that I'm wondering the OP in this doc must be symmetric or not in the context.

Ref: https://www.caam.rice.edu/software/ARPACK/UG/node136.html#SECTION001210000000000000000


Solution 1:

For $3\times 3$ put $$ B:=\left [\begin{array}{ccc}1&0&0 \\ 0&1&0 \\ 0&0&0\end{array} \right ] \quad\mbox{and}\quad A := \left [\begin{array}{ccc}1&2&0 \\ 2&3&0 \\ 3&4&5\end{array} \right ],$$ for instance.


As for how I came up with it: obviously, when $B$ is the identity $A$ must be symmetric. So replace $B$ with a diagonal matrix that leaves more variables free. May replicate this idea in any dimension $n\geqslant 3$.