After updating my php version to 5.4.0-3, I'm getting a strange PHP error.
I have this array:
Array ( [host] => 127.0.0.1 [port] => 11211 )
I get weird warnings when I try to access it like this
print $memcachedConfig['host']; print $memcachedConfig['port']; Warning: Illegal string offset 'host' in .... Warning: Illegal string offset 'port' in ...
I really don't want to just edit my php.ini and reset the error level.
Error
Illegal string offset 'whatever' in...
Usually means: You are trying to use a string as a complete array.This is actually possible because in php strings can be treated as arrays of single characters. So you think $var is an array with keys, but it's just a string with standard numeric keys, for example:
You can see the actual effect here: http://ideone.com/fMhmkR
For those of you asking this question and trying to turn false ambiguity into a solution, like me.
Please try this way...I have tested this code...it works...