Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: loose thinking Date: Tue, 24 Jan 2012 17:02:07 +0100 Organization: A noiseless patient Spider Lines: 35 Message-ID: <4F1ED5FF.6070701@arnowelzel.de> References: <9o7h5fFu6rU1@mid.uni-berlin.de> <9o7q84F33fU1@mid.uni-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="dd4uQGf4fHOQcq7/hg1u1Q"; logging-data="24718"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ymom0nv0s7hWlk1cvznFdiWdI3HOV8lI=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <9o7q84F33fU1@mid.uni-berlin.de> Cancel-Lock: sha1:eb6LxXejBHMmYANCZGs+DjKfyaw= Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4600 M. Strobel, 2012-01-24 14:32: > Am 24.01.2012 14:04, schrieb "Álvaro G. Vicario": >> El 24/01/2012 11:57, M. Strobel escribió/wrote: >>> I hate this sloppiness of PHP: [...] >>> There is no difference between an empty string and null in array indexing. That is >>> stupid. Why does the language not just respect my definitions? >> >> Because your make your definitions fit in something that already have a previous >> definition. String keys must be integers or strings, as documented: >> >> http://es.php.net/manual/en/language.types.array.php#language.types.array.syntax.array-func [...] > I am angry about it because not even isset() respects the null value here. I think it > makes more sense this way: isset($a[null]) should return false, because there is no > null index. > > The point is that the designers of PHP (if you can talk about design here) probably > meant to help programmers in not making all these hideous type distinctions, but the > outcome is you have to be really careful about loose comparison and unwanted type > conversion, having to write even more if constructs. Well - the roots of PHP are PHP/FI which could not be called a "designed" language. See *scnr* -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de