title: Change serial port baud rate in runtime and strange effect
body: <p>I've encountered strange problem - I have to change serial port baud rate (from initial 300 baud to something higher) in runtime of PHP code and every time I try, next readed bytes are simply ZEROs.</p>
  
  <p>I've already tried multiple ways of serial connection in PHP:</p>
  
  <ul>
  <li>fopen/fread/fwrite of standard file (in that case "/dev/ttyUSB0"), configured with exec and stty commands</li>
  <li>dio_open/dio_read/dio_write, configured with dio_tcsetattr</li>
  <li>fopen/fread/fwrite of dio stream (dio.serial type)</li>
  </ul>
  
  <p>I'm pretty sure that there's something wrong in PHP itself, because similar code in Perl works correctly and baud rate doesn't affect reading at all. I've checked strace log of PHP and Perl scripts and they look almost identical in case of serial port configuration, so problem lies somewhere else.</p>