On Wed, November 3, 2010 8:52 pm, Stanley Sufficool wrote: > Before I gut PDO_DBLIB one more time to implement native parameter > binding for stored procedures, what are the thoughts on returning the > column values from the database as the native PHP type when possible? > Currently everything is returned as a string, incurring overhead for > conversion and creating problems hinting at the desired binding type > for BLOBS and numeric data types.
It *SEEMS* like a Good Idea (tm) until you think it through and realize that there is NOT a one-to-one correspondence between PHP native types and DB native types. Even what seems like a no-brainer for, say, INT is not. Does PHP INT have the same range as the DB INT? Dollars to doughnuts says "No." is the correct answer. BIGINT? Not a chance. PHP doesn't really do bigint, unless you want to return some GMP thing, which is probably not a Good Idea, as GMP isn't always there, I don't think. Then you start looking at things like an enum, or GeoIP, or IP address as native DB types, and it gets really ugly, really fast. -- brain cancer update: http://richardlynch.blogspot.com/search/label/brain%20tumor Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php