Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4592

loose thinking

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!not-for-mail
From "M. Strobel" <sorry_no_mail_here@nowhere.dee>
Newsgroups comp.lang.php
Subject loose thinking
Date Tue, 24 Jan 2012 11:57:51 +0100
Lines 25
Message-ID <9o7h5fFu6rU1@mid.uni-berlin.de> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de g83kWozxjmCC/uuWdAzT8gb254gIbiKbbi/b5N/WABzZc7hmA=
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.24) Gecko/20111101 Thunderbird/3.1.16
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:4592

Show key headers only | View raw


I hate this sloppiness of PHP:

strobel@s114-intel:~> php -a
Interactive shell

php > $a[null] = 'you are Nothing';
php > var_dump($a);
array(1) {
  [""]=>
  string(15) "you are Nothing"
}
php > $i=null;
php > $a[$i] = 'you are Nothing';
php > var_dump($a);
array(1) {
  [""]=>
  string(15) "you are Nothing"
}
php > var_dump(key($a));
string(0) ""

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?

/Str.

Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

loose thinking "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-24 11:57 +0100
  Re: loose thinking "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-01-24 14:04 +0100
    Re: loose thinking "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-24 14:32 +0100
      Re: loose thinking The Natural Philosopher <tnp@invalid.invalid> - 2012-01-24 13:41 +0000
        Re: loose thinking Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-24 09:35 -0500
      Re: loose thinking "Peter H. Coffin" <hellsop@ninehells.com> - 2012-01-24 08:16 -0600
        Re: loose thinking "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-24 17:35 +0100
          Re: loose thinking The Natural Philosopher <tnp@invalid.invalid> - 2012-01-24 16:59 +0000
            Re: loose thinking "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-24 19:11 +0100
        Re: loose thinking Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-25 04:49 +0100
          Re: loose thinking "Peter H. Coffin" <hellsop@ninehells.com> - 2012-01-25 07:58 -0600
            Re: loose thinking Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-25 20:37 +0100
      Re: loose thinking "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-01-24 16:20 +0100
        Re: loose thinking The Natural Philosopher <tnp@invalid.invalid> - 2012-01-24 15:43 +0000
        Re: loose thinking "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-24 19:43 +0100
      Re: loose thinking Arno Welzel <usenet@arnowelzel.de> - 2012-01-24 17:02 +0100
        Re: loose thinking "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-24 17:28 +0100

csiph-web