title: PDO Prepared Statements defaulting to emulation
body: <p>I have read several times that, by default, PDO does not use native prepared statements, but prefers to emulate them. To enable true prepared statements, you can add:</p>
  
  <pre><code>$pdo-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
  </code></pre>
  
  <p>I have also read that this is the case for MySQL, but not for PostgreSQL.</p>
  
  <p>The one place I really expected to read that was PHP’s web site, but I find no mention of it at all.</p>
  
  <p>The closest I can find to that is from <a href="http://php.net/manual/en/pdo.prepare.php" rel="nofollow noreferrer">http://php.net/manual/en/pdo.prepare.php</a>:</p>
  
  <blockquote>
    <p>PDO will emulate prepared statements/bound parameters for drivers that do not natively support them, and can also rewrite named or question mark style parameter markers to something more appropriate, if the driver supports one style but not the other.</p>
  </blockquote>
  
  <p>In <a href="http://www.php.net/manual/en/ref.pdo-mysql.php" rel="nofollow noreferrer">http://www.php.net/manual/en/ref.pdo-mysql.php</a> it says:</p>
  
  <blockquote>
    <p>PDO_MYSQL will take advantage of native prepared statement support present in MySQL 4.1 and higher. If you're using an older version of the mysql client libraries, PDO will emulate them for you. </p>
  </blockquote>
  
  <p>Personally, I prefer to use true prepared statements, so that’s easy enough to fix, especially in 2017 where database support is pretty good.</p>
  
  <p>The question is: <em>Where</em> is it documented that PDO defaults to emulated prepares? Also, does this apply to <em>all</em> databases or some?</p>
  
  <p><strong>Note:</strong> There is an existing question at <a href="https://stackoverflow.com/questions/10617057/does-pdo-always-use-emulated-prepared-statements-by-default">Does PDO always use emulated prepared statements by default?</a>. This is <em>not</em> a duplicate (I have already read that one):</p>
  
  <ul>
  <li>The question is 5 years old</li>
  <li>The links are dead</li>
  <li>There is some dissent in the comments.</li>
  </ul>
  
  <p>That question does not tell me where this is actually documented.</p>