Re: [PHP-DEV] GMP memory allocator, various issues

2014-10-20 Thread Remi Collet
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le 10/10/2014 10:39, Remi Collet a écrit : > Hi, > > See https://bugs.php.net/63595 > > > Short, changing gmp memory allocator can cause segfaults in > various case where gnutls is used and initialized "before" gmp. > > - php + gmp + curl => segfau

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Theodore Brown
On Oct 20 2014, at 8:07 PM, Josh Watzman wrote: > I think this is pretty cool, but I'm really worried about some of its typing > implications. In particular: > >> The functions return FALSE on failure instead of NULL because: > > Throwing an exception or even returning NULL seems so much better

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Stas Malyshev
Hi! > No, not quite. One of the nice things about rejecting whitespace is > it lets you handle it however you want. Want to reject all > whitespace? to_int($foo). Want to accept all whitespace? > to_int(trim($foo)). Want to trim only tabs? to_int(trim($foo, “\t”)). > This is actually allows more f

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Andrea Faulds
> On 21 Oct 2014, at 02:08, Stas Malyshev wrote: > >> Actually, to_int is very close to FILTER_VALIDATE_INT, and I’m not >> sure, but I think to_float may be close to FILTER_VALIDATE_FLOAT. The >> main difference with integers is rejection of whitespace and >> toString-able objects. > > So esse

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Andrea Faulds
> On 21 Oct 2014, at 02:07, Josh Watzman wrote: > > Throwing an exception or even returning NULL seems so much better than > returning "false" -- "false" is a boolean, not an error, and despite some > historical cases of PHP using "false" as a poor person's error code, it > really isn’t. Why

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Stas Malyshev
Hi! >> Wait, we actually already have FILTER_VALIDATE_INT and >> FILTER_VALIDATE_FLOAT, > > Actually, to_int is very close to FILTER_VALIDATE_INT, and I’m not > sure, but I think to_float may be close to FILTER_VALIDATE_FLOAT. The > main difference with integers is rejection of whitespace and >

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Josh Watzman
On Oct 20, 2014, at 3:57 PM, Andrea Faulds wrote: > Good evening, > > I am presenting a new RFC to add a set of three functions to do validated > casts for scalar types: > > https://wiki.php.net/rfc/safe_cast > > Please read it. > > Thanks! I think this is pretty cool, but I'm really worrie

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Andrea Faulds
Hi! > On 21 Oct 2014, at 01:32, Stas Malyshev wrote: > > The main problem that happened with scalar typing RFC remains here: > third set of rules for casting types. Of course, since it's "just" > functions and not language constructs, we can have a set of functions > for any set of casting rules

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Stas Malyshev
Hi! > I am presenting a new RFC to add a set of three functions to do validated > casts for scalar types: > > https://wiki.php.net/rfc/safe_cast > > Please read it. The main problem that happened with scalar typing RFC remains here: third set of rules for casting types. Of course, since it's "

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Andrea Faulds
> On 21 Oct 2014, at 00:27, Lars Strojny wrote: > > I like the proposal except for one thing: the functions returning false in > case of an error. As the next logical function would be "to_bool()", I > foresee a lot of trouble with regards to API design as returning false there > either means

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Lars Strojny
Hi Andrea, > On 21 Oct 2014, at 00:57, Andrea Faulds wrote: > > Good evening, > > I am presenting a new RFC to add a set of three functions to do validated > casts for scalar types: > > https://wiki.php.net/rfc/safe_cast > > Please read it. I like the proposal except for one thing: the fun

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Andrea Faulds
> On 21 Oct 2014, at 00:16, Haralan Dobrev wrote: > > In general I like this RFC. > > I don't see why to_string would not accept and cast integers and floats to > strings. And even if there is a valid reason it is not mentioned. It does accept and cast integers and floats to strings… I made a

Re: [PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Haralan Dobrev
In general I like this RFC. I don't see why to_string would not accept and cast integers and floats to strings. And even if there is a valid reason it is not mentioned. If this gets accepted you should consider the naming in the user documentation. Beginners should not consider these functions "s

[PHP-DEV] [RFC] Safe Casting Functions

2014-10-20 Thread Andrea Faulds
Good evening, I am presenting a new RFC to add a set of three functions to do validated casts for scalar types: https://wiki.php.net/rfc/safe_cast Please read it. Thanks! -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://

[PHP-DEV] VCS Account Request: ivangabriele

2014-10-20 Thread Ivan Gabriele
Hi, I would like to get a Git account to translate missing parts in French. I am French, perfectly fluent in English and I have been developing in PHP for more than 10 years. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Reflection-API

2014-10-20 Thread Markus Fischer
Hi Chris, On 20.10.14 12:10, Chris Wright wrote: [...] in depth summary of future idea ReflectionType Thanks a lot for the clarification and regarding the future expansion of the use of ReflectionType I now better understand most points and why they're currently are that way. I don't think I've

Re: [PHP-DEV] Reflection-API (was: Re: [PHP-DEV] RFC: Return Types Update)

2014-10-20 Thread Chris Wright
Markus On 19 October 2014 20:31, Markus Fischer wrote: > On 16.10.14 06:39, Levi Morrison wrote: >> - The design and accompanying section of reflection[3] has been >> rewritten entirely. >> >> [3]: https://wiki.php.net/rfc/returntypehinting#reflection > > I've some comments about the Reflecti

Re: [PHP-DEV] always_populate_raw_post_data E_DEPRECATED thrown by default

2014-10-20 Thread Ferenc Kovacs
2014.10.20. 10:21 ezt írta ("Rowan Collins" ): > > On 20 October 2014 05:48:04 GMT+01:00, Davey Shafik wrote: > >Hey folks, > > > >A thread on reddit (here: > > https://www.reddit.com/r/PHP/comments/2jpzzj/php_56_throws_e_deprecated_by_default_for_no/ ) > >noted that in 5.6 there is an E_DEPRECATE

Re: [PHP-DEV] always_populate_raw_post_data E_DEPRECATED thrown by default

2014-10-20 Thread Rowan Collins
On 20 October 2014 05:48:04 GMT+01:00, Davey Shafik wrote: >Hey folks, > >A thread on reddit (here: >https://www.reddit.com/r/PHP/comments/2jpzzj/php_56_throws_e_deprecated_by_default_for_no/) >noted that in 5.6 there is an E_DEPRECATED thrown if >"always_populate_raw_post_data" is set to anything