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 da...@php.net 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

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 rowan.coll...@gmail.com): On 20 October 2014 05:48:04 GMT+01:00, Davey Shafik da...@php.net 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

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 mar...@fischer.name 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

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

[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

[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:

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

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

2014-10-20 Thread Andrea Faulds
On 21 Oct 2014, at 00:16, Haralan Dobrev hkdob...@gmail.com 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

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

2014-10-20 Thread Lars Strojny
Hi Andrea, On 21 Oct 2014, at 00:57, Andrea Faulds a...@ajf.me 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

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

2014-10-20 Thread Andrea Faulds
On 21 Oct 2014, at 00:27, Lars Strojny l...@strojny.net 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

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 just

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

2014-10-20 Thread Andrea Faulds
Hi! On 21 Oct 2014, at 01:32, Stas Malyshev smalys...@sugarcrm.com 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

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

2014-10-20 Thread Josh Watzman
On Oct 20, 2014, at 3:57 PM, Andrea Faulds a...@ajf.me 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

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 Andrea Faulds
On 21 Oct 2014, at 02:07, Josh Watzman jwatz...@fb.com 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.

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

2014-10-20 Thread Andrea Faulds
On 21 Oct 2014, at 02:08, Stas Malyshev smalys...@sugarcrm.com 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.

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