Re: [PHP-DEV] Calling a class constructor

2008-05-02 Thread Marcus Boerger
Hello Antony, Johannes, seeing this thread I agree. So that makes the list: PCRE, Reflection, SPL. Johannes? Wednesday, April 30, 2008, 9:22:19 PM, you wrote: On 30.04.2008 23:17, Lars Strojny wrote: Hi all, esp. Johannes, Am Mittwoch, den 30.04.2008, 13:05 -0400 schrieb Sam Barrow:

Re: [PHP-DEV] Calling a class constructor

2008-05-02 Thread Johannes Schlüter
On Fri, 2008-05-02 at 12:03 +0200, Marcus Boerger wrote: Hello Antony, Johannes, seeing this thread I agree. So that makes the list: PCRE, Reflection, SPL. Johannes? I was under the impression that was already the case for Reflection, so I don't mind. johannes -- PHP Internals - PHP

[PHP-DEV] Float comparison

2008-05-02 Thread Jonathan Bond-Caron
Hi, I'm new to the PHP internals list and I'm posting an issue I'm sure has been mentioned before -- float comparison I'd like to know if there are reasons not to change the default behavior when comparing floats. i.e. This would seem logical to me: $test =

[PHP-DEV] CVS Account Request: jpcummins

2008-05-02 Thread J.P. Cummins
Make Phalanger and DLR version of PHP that is compliant with all PHP standards and unit test(s). -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Pierre Joye
On Fri, May 2, 2008 at 6:52 PM, Jonathan Bond-Caron [EMAIL PROTECTED] wrote: Hi, I'm new to the PHP internals list and I'm posting an issue I'm sure has been mentioned before -- float comparison I'd like to know if there are reasons not to change the default behavior when comparing

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Andrey Hristov
Hi, Jonathan Bond-Caron wrote: Hi, I'm new to the PHP internals list and I'm posting an issue I'm sure has been mentioned before -- float comparison I'd like to know if there are reasons not to change the default behavior when comparing floats. i.e. This would seem logical to me:

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Todd Ruth
I'm afraid you'll find Pierre's response representative. The php devs seem to consider the fact that a theoretically perfect == doesn't exist to mean that the improvements that would cover 99.9% of user issues with float == shouldn't be made. It could be worse, however. At least the cast to

RE: [PHP-DEV] Float comparison

2008-05-02 Thread Jonathan Bond-Caron
Thanks Pierre, I realize it's not a bug and I've read some bogus reports :) But since (float)(string)$test == (double)1960 is 'correct' My question is: can php do the conversion internally? It would seem *very* convenient for users, If not changing the float behavior, I'm advocating for a

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Pierre Joye
Hi Todd, On Fri, May 2, 2008 at 7:36 PM, Todd Ruth [EMAIL PROTECTED] wrote: I'm afraid you'll find Pierre's response representative. The php devs seem to consider the fact that a theoretically perfect == doesn't exist We are not the ones to consider that, that's a fact since the very first

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Stefan Walk
Todd Ruth schrieb: I'm afraid you'll find Pierre's response representative. The php devs seem to consider the fact that a theoretically perfect == doesn't exist to mean that the improvements that would cover 99.9% of user issues with float == shouldn't be made. It could be worse, however.

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Rasmus Lerdorf
Stefan Walk wrote: And you'll quickly see that the cast to string before comparision is a bad idea, because: $ php -dprecision=1 -r 'var_dump((string)1.4 == (string)1.1);' bool(true) Having display settings affect comparisions seems like a really bad idea to me ;) Yup, it would be a fatal

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Todd Ruth
On Fri, 2008-05-02 at 11:41 -0700, Rasmus Lerdorf wrote: Stefan Walk wrote: And you'll quickly see that the cast to string before comparision is a bad idea, because: $ php -dprecision=1 -r 'var_dump((string)1.4 == (string)1.1);' bool(true) Having display settings affect comparisions

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Pierre Joye
Hi Todd, On Fri, May 2, 2008 at 10:03 PM, Todd Ruth [EMAIL PROTECTED] wrote: (BTW, Pierre, the statement X considers the fact that S1 to mean that S2 is a statement _agreeing_ with S1. It calls into question whether S1 implies S2. I agree a perfect solution to the problems we're

[PHP-DEV] small bug in date()

2008-05-02 Thread Jon L.
php-5.2.6\ext\date\php_date.c @ 813-820 rfc_colon isn't reset between the 'O' and 'P' format characters. Allowing (date('P O') === date('P P')) to return true. Has anyone else noticed this? - Jon L.

Re: [PHP-DEV] small bug in date()

2008-05-02 Thread Derick Rethans
On Fri, 2 May 2008, Jon L. wrote: php-5.2.6\ext\date\php_date.c @ 813-820 rfc_colon isn't reset between the 'O' and 'P' format characters. Allowing (date('P O') === date('P P')) to return true. Has anyone else noticed this? No, but I just fixed it in CVS for PHP 5.3 and HEAD, and will do

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Alain Williams
On Fri, May 02, 2008 at 01:03:45PM -0700, Todd Ruth wrote: On Fri, 2008-05-02 at 11:41 -0700, Rasmus Lerdorf wrote: Stefan Walk wrote: And you'll quickly see that the cast to string before comparision is a bad idea, because: $ php -dprecision=1 -r 'var_dump((string)1.4 ==

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Richard Quadling
2008/5/3 Alain Williams [EMAIL PROTECTED]: On Fri, May 02, 2008 at 01:03:45PM -0700, Todd Ruth wrote: On Fri, 2008-05-02 at 11:41 -0700, Rasmus Lerdorf wrote: Stefan Walk wrote: And you'll quickly see that the cast to string before comparision is a bad idea, because: $ php

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Stanislav Malyshev
Hi! What about introducing a money or currency numeric type which guarantees say accuracy to 8DP? Funny thing - I blogged about it about a year ago: http://php100.wordpress.com/2007/03/31/making-with-php/ There's some interesting discussion in comments about how people solve it. -- Stanislav

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Richard Quadling
2008/5/3 Stanislav Malyshev [EMAIL PROTECTED]: Hi! What about introducing a money or currency numeric type which guarantees say accuracy to 8DP? Funny thing - I blogged about it about a year ago: http://php100.wordpress.com/2007/03/31/making-with-php/ There's some interesting

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Stanislav Malyshev
Hi! Solvable in userland easily enough, but having a native money type, especially when dealing with inter-currency conversions, then accuracy is paramount. Adding native primitive type is expensive - there's a lot of places in engine and various functions that have to deal with primitive

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Richard Quadling
2008/5/3 Stanislav Malyshev [EMAIL PROTECTED]: Hi! Solvable in userland easily enough, but having a native money type, especially when dealing with inter-currency conversions, then accuracy is paramount. Adding native primitive type is expensive - there's a lot of places in engine

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Stanislav Malyshev
Hi! Is it not possible to overload operators? Though this would probably even more work to do. Well, overloading operators in theory would be less work to do, technically, since extension points would be easier to identify. However, I'm not sure we'd want to open that can of worms :) --

Re: [PHP-DEV] Float comparison

2008-05-02 Thread Cristian Rodríguez
Todd Ruth escribió: Most people don't care about floating numbers beyond a certain number of digits. That's the main flaw in your suggestion, most people.. the language should be correct, do the real right thing. -- Progress is possible only if we train ourselves to think about