[wp-trac] [WordPress Trac] #27765: Add ARRAY_K return type to wpdb::get_results()
WordPress Trac
noreply at wordpress.org
Thu Jun 12 14:32:10 UTC 2014
#27765: Add ARRAY_K return type to wpdb::get_results()
-------------------------+------------------
Reporter: jdgrimes | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.0
Component: Database | Version: 3.8
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+------------------
Changes (by nacin):
* keywords: has-patch commit => has-patch
Comment:
Potential downside: Most DB drop-ins have only implemented OBJECT_K,
ARRAY_A, ARRAY_N, and OBJECT. The newest one, OBJECT_K, was still added a
solid five years ago. There's no way of knowing whether a drop-in supports
the newer ARRAY_K, and using it in your code suddenly means things will
fatal error (accessing an object as an array), when all you wanted was a
quick shortcut.
OBJECT_K is awesome but it comes up pretty rarely in practice. I probably
use it more than anyone. Is making this more complex necessary and worth
it? You can always do this cast yourself in your loop.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27765#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list