On Fri, Jan 14, 2011 at 10:42:52AM +0100, Coen Schalkwijk wrote:
...bumped right into a new problem:
mapping(string:mixed) map = ([]);
string s;
map["test_null"] = s;
_typeof(map["test_null"]);
zero
which is fine by me, but:
typeof(map["test_null"]);
mixed
which is not so nice :( and if the variable s has a value:
why?
map["test_null"] = "no_so_null";
typeof(map["test_null"]);
mixed
but then:
_ typeof(map["test_null"]);
string
this is the expected behaviour.
typeof() gives the type of the variable which you above defined as
mixed.
_typeof() gives the type of the value, which, as we can see, is a
string.
Am I asking something extremely stupid if I'd like to know if it's
possible to determine the (original) type of the string in the mapping?
what do you mean by original type?
greetings, martin.