FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » loose thinking
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: loose thinking [message #176797 is a reply to message #176795] Wed, 25 January 2012 13:58 Go to previous messageGo to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Open Source Customization
Next Topic: Product page getting Redirect back to Home page - Please Fix
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 09:17:36 GMT 2024

Total time taken to generate the page: 0.03881 seconds