[wp-trac] [WordPress Trac] #27133: Redundant type casting in wp_get_object_terms

WordPress Trac noreply at wordpress.org
Sat Feb 15 17:35:00 UTC 2014


#27133: Redundant type casting in wp_get_object_terms
-------------------------+------------------------------
 Reporter:  OriginalEXE  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Taxonomy     |     Version:  trunk
 Severity:  minor        |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------

Comment (by nacin):

 Blind type-casting can cause its own hidden issues. `(array) null`
 produces `array()` but `(array) false` (length of 0) produces `array( 0 =>
 false )` (length of 1). It's best to be explicit; is_array() is not
 exactly slow.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27133#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list