Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <2259043.FRqVoOGUtd@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 25 Jan 2012 20:37:52 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: loose thinking Newsgroups: comp.lang.php References: <9o7h5fFu6rU1@mid.uni-berlin.de> <9o7q84F33fU1@mid.uni-berlin.de> <2028906.az0AgUPcgG@PointedEars.de> Followup-To: comp.lang.php MIME-Version: 1.0 Lines: 74 NNTP-Posting-Date: 25 Jan 2012 20:37:52 CET NNTP-Posting-Host: 534a10ce.newsspool3.arcor-online.net X-Trace: DXC=JVQR=SZn3B:^8FBo0_81f>McF=Q^Z^V384Fo<]lROoR18kF@dMN77i@H1lDG^ 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. I do not follow. Please explain why you think (operator) precedence has something to do with this problem. >> 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 >> ??? There were no question marks in my posting, there was an ellipsis. Please get a working newsreader; Unicode and UTF-8 are anything but new or exotic nowadays. > null's a special case that's NOT reported. Other cases of this are > reported. > > hellsop /home/hellsop > [07:57:10] $ cat foo.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 Please notice that this is only a notice. > Array > ( > [q] => r > ) > hellsop /home/hellsop > [07:57:15] $ Because `null' is a reserved word, thus cannot be the identifier of a constant. Where `null' is the value of another expression (like a variable reference), PHP shows its being influenced by C, Perl and Tcl, and its applicability as a shell scripting language, where (with the exception of C) loose typing is common and you do not have to declare variables before you refer to them. PointedEars -- realism: HTML 4.01 Strict evangelism: XHTML 1.0 Strict madness: XHTML 1.1 as application/xhtml+xml -- Bjoern Hoehrmann