Re: [PHP-DEV] Re: why is '01' == '1.'?

2005-12-15 Thread Ilia Alshanetsky
Bart de Boer wrote: > However, XForms will have numeric datatypes. :| > > http://www.w3.org/TR/2003/REC-xforms-20031014/slice5.html And no one in their right mind uses them. Ilia -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread Carl P. Corliss
Greg Beaver wrote: Hi all, I realize that 1 == '01' and 1 == '1.', but why is this next code also bool(true)? http://us3.php.net/manual/en/language.types.string.php#language.types.string.conversion Also, if you want strict type checking, try using === -- Carl -- PHP Internals - PHP

Re: [PHP-DEV] php 5.1.1 syntax errors

2005-12-15 Thread Jochem Maas
Daine Mamacos wrote: I think I know what this is due to. I have an autoloader in places for classes. It seems that when a class is autoloaded, no matter what you do, it won't bother throwing an error when it loads a class. It however just stops processing. FULL STOP. If the error is in the localf

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread M. Sokolewicz
actually, you're right in that (colder.ch) since what happens here is a conversion. This applies to all these 'logic cases' posted. When something is converted to something else, as part of a process, you can't state that the process returns unique results (meaning the result always points back

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread colder.ch
No, this rule of logic can't be applied : 2 == true and true == 10, but 2 != 10 It all depends on the types of the compared values. Hans Melis wrote: >a == b and a == c implies by the rules of logic that b == c > > -- Etienne Kneuss http://www.colder.ch/ [EMAIL PROTECTED] -- PHP Internals

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread Hans Melis
Greg Beaver wrote: > Hi all, > > I realize that 1 == '01' and 1 == '1.', but why is this next code also > bool(true)? > > var_dump('1.' == '01'); > ?> > That is pure logic... a == b and a == c implies by the rules of logic that b == c -- Hans avast! Antivirus: Outbound message clean. Virus

Re: [PHP-DEV] php 5.1.1 syntax errors

2005-12-15 Thread Daine Mamacos
I think I know what this is due to. I have an autoloader in places for classes. It seems that when a class is autoloaded, no matter what you do, it won't bother throwing an error when it loads a class. It however just stops processing. FULL STOP. If the error is in the localfile, it works fine. run

[PHP-DEV] Re: why is '01' == '1.'?

2005-12-15 Thread Bart de Boer
> Don't forget that one fundamental aspect of PHP is, that it's a web > language and thus receives most of its input from the web. > Therefore it usually only gets strings as input. > > Consider ($_POST['intfield1'] == $_POST['intfield2']) > > Both variables would be strings. Still if someone would

[PHP-DEV] Re: why is '01' == '1.'?

2005-12-15 Thread Bart de Boer
Don't forget that one fundamental aspect of PHP is, that it's a web language and thus receives most of its input from the web. Therefore it usually only gets strings as input. Consider ($_POST['intfield1'] == $_POST['intfield2']) Both variables would be strings. Still if someone would input '01'

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread Zeev Suraski
At 16:33 15/12/2005, Greg Beaver wrote: Stefan Walk wrote: > See http://bugs.php.net/bug.php?id=23110 > > It's definitely a gotcha, especially if you use switch(){}, as there > is no way to do strict type checking there. Please reconsider the decision to leave this bug open in PHP, any unexpecte

Re: [PHP-DEV] php 5.1.1 syntax errors

2005-12-15 Thread Jochem Maas
internals, it may be a badly worded (and inappropriately directed) post BUT I can categorically say that php5+ does have problems with displaying errors under certain circumstances - you see nothing anywhere regardless of ini/log/display settings. I have had such issues since php.5.0.3beta, I ha

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread Greg Beaver
Stefan Walk wrote: > See http://bugs.php.net/bug.php?id=23110 > > It's definitely a gotcha, especially if you use switch(){}, as there > is no way to do strict type checking there. Please reconsider the decision to leave this bug open in PHP, any unexpected behavior in an operator as fundamental

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread Jason Sweat
On 12/14/05, Greg Beaver <[EMAIL PROTECTED]> wrote: > In this case, a string is explicitly being compared to a string, and yet > both are being converted to an int prior to comparison. I can > understand that implicit type conversion is needed when comparing > strings to ints, but this can be dang

[PHP-DEV] php 5.1.1 syntax errors

2005-12-15 Thread Daine Mamacos
Is there any reason why the php 5.1.1 command processor does not report syntax errors despite all errors being on in the .ini file? Maybe I'm doing something stupid. -- random signature -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread Ron Korving
This may sound like a screwed up idea, and I'm not even sure if I would support it, but just something that went through my mind: A 2nd (flag) parameter for switch could do miracles: switch ($var, SWITCH_STRICT) { } and could be used for more than just strict checks: switch ($var, SWITCH_STRIC

Re: [PHP-DEV] why is '01' == '1.'?

2005-12-15 Thread Stefan Walk
See http://bugs.php.net/bug.php?id=23110 It's definitely a gotcha, especially if you use switch(){}, as there is no way to do strict type checking there. Regards, Stefan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php