Re: PDO: Disable emulated prepares by default?
| From: | Andrea Faulds | Date: | Sun, 06 Sep 2015 17:25:13 +0000 |
| Subject: | Re: PDO: Disable emulated prepares by default? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88063@lists.php.net to get a copy of this message | ||
Hi Scott,
Scott Arciszewski wrote:
Inspired by http://stackoverflow.com/a/12202218/2224584 Can we (in either PHP 7.0 or in PHP 7.1) turn emulated prepared statements off by default, and still allow developers to turn it on if they really want them? For now my code works around this design decision, but not everybody is cognizant of this behavior.I don't know if there's really still time to add this in PHP 7.0, but I think emulated prepares being switched off would be a good idea. One reason in particular is that this means we'd get properly typed results, rather than just strings, which would work better with PHP 7's new scalar type hints. PDO returning strings everywhere when using emulation was one thing I was completely unaware of until I turned on strict typing. Cheers. -- Andrea Faulds http://ajf.me/