I have this question from the Zend PHP study guide and can\'t find a proper explanation...
Since __get()
calls echo
, some data is being outputted before the echo
outside of the class gets called.
Stepping through the first line with echo
, this is how it gets executed:
$m->a "A" is concatenated
"," "," is concatenated
$m->b "b," is echoed, "B" is concatenated
"," "," is concatenated
$m->c "c," is echoed, "C" is concatenated
"m" "," is concatenated
At this point, b,c,
has already been echo
ed, and the string with the value of A,B,Cm
is now displayed.