The expression $lon of type string|false is loosely compared to false; this is ambiguous if the string can be empty. You might want to explicitly use === false instead.
In PHP, under loose comparison (like ==, or !=, or switch conditions),
values of different types might be equal.
For string values, the empty string '' is a special case, in particular
the following results might be unexpected:
''==false// true''==null// true'ab'==false// false'ab'==null// false// It is often better to use strict comparison''===false// false''===null// false
The expression $lat of type string|false is loosely compared to false; this is ambiguous if the string can be empty. You might want to explicitly use === false instead.
In PHP, under loose comparison (like ==, or !=, or switch conditions),
values of different types might be equal.
For string values, the empty string '' is a special case, in particular
the following results might be unexpected:
''==false// true''==null// true'ab'==false// false'ab'==null// false// It is often better to use strict comparison''===false// false''===null// false
Loading history...
42
2
return null;
43
}
44
45
1
return new LatLongValue( (float)$lat, (float)$lon );
46
}
47
48
/**
49
* @param string $address
50
*
51
* @return string
52
*/
53
4
private function getRequestUrl( $address ) {
54
return 'http://api.geonames.org/search?q='
55
4
. urlencode( $address )
56
4
. '&maxRows=1&username='
57
4
. urlencode( $this->geoNamesUser );
58
}
59
60
3
private function getXmlElementValue( $xml, $tagName ) {
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: