Illegal string offset Warning PHP

The error Illegal string offset ‘whatever’ in… generally means: you’re trying to use a string as a full array. That is actually possible since strings are able to be treated as arrays of single characters in php. So you’re thinking the $var is an array with a key, but it’s just a string with standard … Read more

What causes javac to issue the “uses unchecked or unsafe operations” warning

This comes up in Java 5 and later if you’re using collections without type specifiers (e.g., Arraylist() instead of ArrayList<String>()). It means that the compiler can’t check that you’re using the collection in a type-safe way, using generics. To get rid of the warning, just be specific about what type of objects you’re storing in … Read more

“Notice: Undefined variable”, “Notice: Undefined index”, “Warning: Undefined array key”, and “Notice: Undefined offset” using PHP

Notice / Warning: Undefined variable From the vast wisdom of the PHP Manual: Relying on the default value of an uninitialized variable is problematic in the case of including one file into another which uses the same variable name. It is also a major security risk with register_globals turned on. E_NOTICE level error is issued … Read more