It was frustrating at first because I was trying to get my Linux box to talk to an external serial device (a PIC18F452 programmable chip) and the example provided here refers to fcntl() and open() parameters that aren't in the PHP documentation.
I finally found out what does what through the man pages:
man open
man fcntl
still haven't gotten it to work, or how to reset the ttySx, but thought it may help someone...