title: fread() expects parameter 1 to be resource
body: <p>I have a PHP Warning. </p>
  
  <pre><code>fread() expects parameter 1 to be resource, boolean given in /tmp/func.php on line 12
  </code></pre>
  
  <p>My code :</p>
  
  <pre><code>&lt;?php
  
    $sqlite = 'teleinfo.sqlite';
  
    function getTeleinfo () {
  
      $handle = fopen ('/dev/ttyACM0', "r"); // ouverture du flux
  
      while (fread($handle, 1) != chr(2));
  --------
  </code></pre>
  
  <p>Thank you !</p>
  
  <p>php --version<br>
  PHP 5.4.45-0+deb7u2 (cli) (built: Oct 27 2015 23:22:07)
  Copyright (c) 1997-2014 The PHP Group
  Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies</p>