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


Groups > comp.lang.php > #4609

Re: loose thinking

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 "Peter H. Coffin" <hellsop@ninehells.com>
Newsgroups comp.lang.php
Subject Re: loose thinking
Date Wed, 25 Jan 2012 07:58:35 -0600
Organization A noiseless patient Spider
Lines 53
Message-ID <slrnji02kb.51n.hellsop@nibelheim.ninehells.com> (permalink)
References <9o7h5fFu6rU1@mid.uni-berlin.de> <jfma85$qmb$1@dont-email.me> <9o7q84F33fU1@mid.uni-berlin.de> <slrnjhtf9j.51n.hellsop@nibelheim.ninehells.com> <2028906.az0AgUPcgG@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Info mx04.eternal-september.org; posting-host="le/2G4+BNpieVhQI6uJ2Lw"; logging-data="13813"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rXEKf4HG0VyIK3/lJuw0T"
User-Agent slrn/0.9.9p1 (OpenBSD)
Cancel-Lock sha1:eoRX6oiXXRI2RTdgAsMKS32D7O0=
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:4609

Show key headers only | View raw


On Wed, 25 Jan 2012 04:49:19 +0100, Thomas 'PointedEars' Lahn wrote:
> Peter H. Coffin wrote:
>
>> On Tue, 24 Jan 2012 14:32:52 +0100, M. Strobel wrote:
>>> Okay I see it is well documented. I just started testing.
>>>
>>> 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.
>> 
>> Parens change precedence. Even on functions.
>
> You are missing the point, which is: `null' is being converted to the 
> primitive string value ''.  A key of an *associative* array may be the empty 
> string.  And that is good so.

That's the *same point*, not "missing the point". I'm sorry that I'm not
wandering down the same mental path would, but I don't think in exactly
the same terms you do. Not everybody does. 

> What is questionable here is the implicit type conversion of non-numeric 
> values to string.  But PHP is not alone there, so this behavior can be 
> expected.  It might be nice if E_STRICT reported such spurious conversions 
> or there was an even stricter mode that forbade them.  Perhaps in PHP 6 ???

null's a special case that's NOT reported. Other cases of this are
reported.

hellsop /home/hellsop
[07:57:10] $ cat foo.php
<?php

$arr = array( q => 'r');

print_r($arr);

?>
hellsop /home/hellsop
[07:57:12] $ php -f foo.php
PHP Notice:  Use of undefined constant q - assumed 'q' in
/home/hellsop/foo.php on line 3
Array
(
    [q] => r
)
hellsop /home/hellsop
[07:57:15] $

-- 
32. I will not fly into a rage and kill a messenger who brings me bad 
   news just to illustrate how evil I really am. Good messengers are 
   hard to come by.
        --Peter Anspach's list of things to do as an Evil Overlord

Back to comp.lang.php | Previous | Next — Previous in thread | 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