[PHP-DEV] Re: [RFC][VOTE] Add session_create_id() function

2016-08-11 Thread Yasuo Ohgaki
Hi all, On Wed, Aug 10, 2016 at 6:14 PM, Yasuo Ohgaki wrote: > This is RFC for adding session_create_id() function. > > Session ID string uses special binary to string conversion. Users > should write lengthy and slow code to have the same session ID string > as session

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Yasuo Ohgaki
Hi Lester, On Thu, Aug 11, 2016 at 5:07 AM, Lester Caine wrote: > People keep complaining that I do not contribute any proposals to > improve PHP, which to some extent s correct. Except the one thing that I > keep trying to get a handle on is tidying validating of the basic >

Re: [PHP-DEV] Fixing #72733 : Implement getaddrinfo

2016-08-11 Thread Bishop Bettini
On Thu, Aug 11, 2016 at 5:59 PM, David Walker wrote: > Hi all, > > I'm looking to resolve this bug, and thought about 2 means in which to > implement the request of exposing C's getaddrinfo() and the addrinfo > structure. There's not really an equivalent means to accomplish

Re: [PHP-DEV] [RFC][VOTE] Add session_create_id() function

2016-08-11 Thread Yasuo Ohgaki
Hi Leigh, On Fri, Aug 12, 2016 at 8:07 AM, Yasuo Ohgaki wrote: > $encoded = base64_encode(ini_get('session.sid_length')*2); > // Use same charset as PHP > $sid = substr(rtrim(strtr($encoded, '+/', ',-'), '='), 0, >

Re: [PHP-DEV] [RFC][VOTE] Add session_create_id() function

2016-08-11 Thread Yasuo Ohgaki
Hi Leigh, One more additional info. On Fri, Aug 12, 2016 at 7:58 AM, Yasuo Ohgaki wrote: > IMHO, mandatory API should be in PHP even if it's easy to implement > and basic API should be in PHP unless it is too easy to be implemented > userland. Session SID validation

Re: [PHP-DEV] [RFC][VOTE] Add session_create_id() function

2016-08-11 Thread Yasuo Ohgaki
On Fri, Aug 12, 2016 at 7:58 AM, Yasuo Ohgaki wrote: > if sid is not there s/if sid is not there/if sid is there/ -- Yasuo Ohgaki yohg...@ohgaki.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC][VOTE] Add session_create_id() function

2016-08-11 Thread Yasuo Ohgaki
Hi Leigh, On Fri, Aug 12, 2016 at 3:25 AM, Leigh wrote: > On Wed, 10 Aug 2016 at 10:15 Yasuo Ohgaki wrote: >> >> Hi all, >> >> This is RFC for adding session_create_id() function. >> >> Session ID string uses special binary to string conversion. Users >>

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Rowan Collins
On 11/08/2016 21:19, Lester Caine wrote: No ... add more than just validation rules. Include facilities such as escape rules, display rules and variable specific material such as error messages. Just how the rules are enforced needs to be flexible and such things as 'required' will vary how the

[PHP-DEV] Fixing #72733 : Implement getaddrinfo

2016-08-11 Thread David Walker
Hi all, I'm looking to resolve this bug, and thought about 2 means in which to implement the request of exposing C's getaddrinfo() and the addrinfo structure. There's not really an equivalent means to accomplish this in userland without trial So I'm not sure the communities best-practices on

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Lester Caine
On 11/08/16 21:22, Fleshgrinder wrote: > What you are describing are classes. You can achieve all of that with them. > > You are completely right btw. that exceptions should not be used during > validation and for flow control. We have said all along that all of this can be done in classes, and

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Fleshgrinder
On 8/11/2016 10:19 PM, Lester Caine wrote: > No ... add more than just validation rules. Include facilities such as > escape rules, display rules and variable specific material such as error > messages. > > Just how the rules are enforced needs to be flexible and such things as > 'required' will

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Lester Caine
On 11/08/16 16:14, Rowan Collins wrote: > On 11/08/2016 15:49, Lester Caine wrote: >> The question is not how >> you flag an error, but rather when do you check for one. If the 'load' >> function from a database record or the populate from a web form results >> in $age not being valid one handles

Re: [PHP-DEV] [RFC][VOTE] Add session_create_id() function

2016-08-11 Thread Leigh
On Wed, 10 Aug 2016 at 10:15 Yasuo Ohgaki wrote: > Hi all, > > This is RFC for adding session_create_id() function. > > Session ID string uses special binary to string conversion. Users > should write lengthy and slow code to have the same session ID string > as session

[PHP-DEV] Wiki karma for writing RFC

2016-08-11 Thread Michał Brzuchalski
Hello, I would like to submit an RFC for adding object type hint. My wiki account name is brzuchal. Thanks, -- Michał Brzuchalski

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Rowan Collins
On 11/08/2016 16:22, Michał Brzuchalski wrote: Wgat about static analysis and IDE support? They probably can handle all those sugarcandies because tgey are sticjed to variable but not with any dynamic rules procedural style. Am I right? Yep, that's a good point, add "machine-friendly"

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Michał Brzuchalski
Wgat about static analysis and IDE support? They probably can handle all those sugarcandies because tgey are sticjed to variable but not with any dynamic rules procedural style. Am I right? 11.08.2016 17:17 "Rowan Collins" napisał(a): > On 11/08/2016 15:49, Lester Caine

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Rowan Collins
On 11/08/2016 15:49, Lester Caine wrote: The question is not how you flag an error, but rather when do you check for one. If the 'load' function from a database record or the populate from a web form results in $age not being valid one handles that situation based on the data model. If you are

[PHP-DEV] NEUTRAL Benchmark Results for PHP Master 2016-08-11

2016-08-11 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-08-11 06:22:57+03:00 commit: 052e69e previous commit:f41b69e revision date: 2016-08-11 09:17:57+09:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Lester Caine
On 11/08/16 14:51, Rowan Collins wrote: > On 11/08/16 13:50, Niklas Keller wrote: >>> > If not by using exceptions, how would you handle them if you assign >>> such >>> > checks to variables and assign a wrong value? > > On 11/08/2016 14:29, Lester Caine wrote: >> if ( !$age->set(

[PHP-DEV] mt_srand with array seed?

2016-08-11 Thread Lauri Kenttä
Hello, Any thoughts about supporting a longer seed array for mt_srand? Does anyone really need it? Should it be in mt_srand or mt_srand_array? See: https://bugs.php.net/bug.php?id=32145 -- Lauri Kenttä -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Rowan Collins
On 11/08/16 13:50, Niklas Keller wrote: > If not by using exceptions, how would you handle them if you assign such > checks to variables and assign a wrong value? On 11/08/2016 14:29, Lester Caine wrote: if ( !$age->set( $result_set['age'] ) ) { // handle error } else { // next step } So,

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Lester Caine
On 11/08/16 13:50, Niklas Keller wrote: >> Now this is where the fundamental difference in styles comes in. >> > PERSONALLY I would not be looking to throw exceptions at all. The whole >> > point of validation is to handle any validation error ... and it is an >> > error not an exception. >> > >

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Niklas Keller
2016-08-11 14:42 GMT+02:00 Lester Caine : > On 11/08/16 04:56, Michał Brzuchalski wrote: > > You want to stick such validation at runtime at any time with variable > and > > throwing \TypeError at any time constraint is broken - wouldn't it cause > of > > throwing much more

Re: [PHP-DEV] Simple variable handling.

2016-08-11 Thread Lester Caine
On 11/08/16 04:56, Michał Brzuchalski wrote: > You want to stick such validation at runtime at any time with variable and > throwing \TypeError at any time constraint is broken - wouldn't it cause of > throwing much more unexpected exceptions during runtime? > Imagine you'll be passing such

Re: [PHP-DEV] GC issue wrt. to resource <-> object cycles?

2016-08-11 Thread Rowan Collins
On 10/08/2016 19:23, Christoph M. Becker wrote: That might be a good idea, even if we already have the XMLReader. And yes, the utf8_* functions don't really belong into ext/xml; frankly, I think they don't belong anywhere – we already have iconv, mbstring and recode which offer a subset of