$y_axis_initial = 20; if ($pdf->CheckPageBreak($image_row_height) == 1){ $y_axis = $y_axis_initial; } This is to do with manual page breaking for a pdf generated document using fpdf. I have narrowed it down to this function I think, as it is not resetting $y_axis on a page break, although it does break the page, So what happens is that the next row gets printed right down the bottom of the new page and triggers another page break with the next row off the page but triggering again. Anyway, can you see what would cause this to break in php5? Sorry to be so longwinded.