Why doesn't the for loop stop when the first statement for $i hits 3? Equally, if I change $i to <=12 the loop is affected by $j being a negative int and doesn't go below -3.
"Each of the expressions can be empty or contain multiple expressions separated by commas. In expr2, all expressions separated by a comma are evaluated but the result is taken from the last part."
So basically that would mean your code will run while $j>=-3
Footnote: I'm a fairly experienced programmer, and I've never seen anyone do anything quite like what you've posted with this question. If it's purely academic, I understand. But if it's going to be part of a deployed application, you might want to post a new question here, and ask about best practices to solve the problem!
http://php.net/manual/en/c
So basically that would mean your code will run while $j>=-3