Upgrading to 4.1 fixed parse error

From the error you posted, I suspect that there was some kind of file corruption. The original file /wp-includes/post.php shouldn’t end at line 235. The file should have 5841 lines (in WP version 4.0 and 4.0.1). If it was a file corruption and the error doesn’t appear anymore, the update probably “healed” the damage by overwriting the file.

Nevertheless I sugest to check your installation, because such a file corruption shouldn’t happen except if someone is messing around with the files.