fix: Code Intelligence: PHP: Better detection of foreach variables
https://bugs.activestate.com/show_bug.cgi?id=100701
rn=

(integrated from trunk branch change 69125c8 by Todd Whiteman <toddw@activestate.com>)