If you call BAR
the e-mail address is set to [email protected]
. But when you call FOO_SEND_EMAIL
, the e-mail address is set to [email protected]
because it is overwritten by FOO
‘s constructor.
You run $sendEmail = new FOO_SEND_EMAIL
, when you do this the constructor of FOO
is called. It has nothing to do with whatever $BAR
currently is.