var_dump(in_array(2, array('2:weird'))); // bool(true)
var_dump(in_array((string) 2, array('2:weird'))); // bool(false)

Comments

kenorb’s picture

Issue summary: View changes
Status: Active » Needs review
thehong’s picture

Issue summary: View changes
thehong’s picture

Issue summary: View changes
stefan.r’s picture

Status: Needs review » Needs work

https://www.drupal.org/coding-standards#cast

Casting

Put a space between the (type) and the $variable in a cast: (int) $mynumber.

gold’s picture

Status: Needs work » Needs review
StatusFileSize
new647 bytes

Fixed.

However, in_array() appears in many places in this file. Is there any reason the other locations are not 'fixed' like this also?

Is this issue even present in this location? If so steps to replicate and demonstrate this would be good.

andrtroe’s picture

Assigned: Unassigned » andrtroe

  • Gold authored 0f47e23 on 7.x-3.x
    Issue #1672380 by thehong, Gold: Issue with in_array()
    
andrtroe’s picture

Status: Needs review » Fixed
Issue tags: +HS release 7.x-3.0-beta10

Guess we wont have any update of this issue, so I will add it to further release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.