Hi Again Folks: On Wed, Nov 23, 2011 at 09:14:09AM -0500, Daniel Convissor wrote: > $a = 'foo'; > echo $a['blah'] . "\n"; > > But that second one echos out "f". This is a huge WTF.
Two things for the record on this front. First, i've been actively using PHP for, what, ten years or so, and have never run into this behavior before. Second, this behavior turns the following one liner: if (isset($arr['package']['attribs']['version'])) { Into this: if (is_array($arr) && array_key_exists('package', $arr) && is_array($arr['package']) && array_key_exists('attribs', $arr['package']) && is_array($arr['package']['attribs']) && array_key_exists('version', $arr['package']['attribs']) && !empty($arr['package']['attribs']['version'])) { Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php