Add fread(length) method

Fixed off-by-one write bug

Added test
Updated NEWS for #65545
Merge branch 'PHP-5.5' into PHP-5.6
Updated NEWS for #65545
Merge branch 'PHP-5.6'