Which sentence is correct? Help laughing or help but laugh [duplicate]

I was wondering which of the following sentence is grammatically correct (British English preferably):

I could not help laughing. I could not help but laugh.

There is a similar question on this site but that does not explain the grammatical correctness of the above mentioned sentences. References are welcome.


From Oxford Learner’s Dictionary:

somebody cannot help (doing) something,

somebody cannot help but do something,

are

used to say that it is impossible to prevent or avoid something.

Examples:

  • I can't help thinking he knows more than he has told us. He can’t help being ugly. She couldn't help but wonder what he was thinking.