Re: [PHP-DEV] RFC Posted for str_begins and str_ends functions

2016-08-12 Thread Bishop Bettini
On Fri, Aug 12, 2016 at 8:37 PM, wrote: > I've updated the RFC to reflect the discussion here and on github. You may > see it at > https://wiki.php.net/rfc/add_str_begin_and_end_functions . You can see > the github PR at https://github.com/php/php-src/pull/2049 . > > The

Re: [PHP-DEV] RFC Posted for str_begins and str_ends functions

2016-08-12 Thread will
I've updated the RFC to reflect the discussion here and on github. You may see it at https://wiki.php.net/rfc/add_str_begin_and_end_functions . You can see the github PR at https://github.com/php/php-src/pull/2049 . The motivation for these changes was to maximize consistency between the

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

2016-08-12 Thread David Walker
On Thu, Aug 11, 2016 at 6:50 PM Bishop Bettini wrote: > I feel the weight of new functions, but really getaddrinfo is meant to > both simplify and unify how sockets are dealt with in the modern era. > socket_getaddrinfo converts the returned linked list into an array of, >

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

2016-08-12 Thread Yasuo Ohgaki
Hi Tom, On Sat, Aug 13, 2016 at 3:11 AM, Tom Worster wrote: > On 8/11/16 6:58 PM, Yasuo Ohgaki wrote: >> >> Hi Leigh, >> >> On Fri, Aug 12, 2016 at 3:25 AM, Leigh wrote: >>> >>> On Wed, 10 Aug 2016 at 10:15 Yasuo Ohgaki wrote:

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

2016-08-12 Thread Bishop Bettini
On Wed, Aug 10, 2016 at 5:30 AM, Yasuo Ohgaki wrote: > Hi all, > > This RFC is to add session_gc() function. > > session_gc() function is required API for periodic session GC that is > best practice for production web sites. > > https://wiki.php.net/rfc/session-gc > It

[PHP-DEV] Re: mt_srand with array seed?

2016-08-12 Thread Lauri Kenttä
On 2016-08-12 21:40, Tom Worster wrote: mt_srand() will work. But what would be in the array? Integers from which the upper 32 bits, if they exist, are discarded? mt19937ar.c contains init_by_array. Compability with that would probably be a good goal, unless someone can point out another

[PHP-DEV] Re: mt_srand with array seed?

2016-08-12 Thread Tom Worster
On 8/11/16 10:13 AM, Lauri Kenttä wrote: 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 The second question is controversial. People have asserted that

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

2016-08-12 Thread Tom Worster
On 8/11/16 6:58 PM, Yasuo Ohgaki wrote: 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

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 12:13, Yasuo Ohgaki wrote: >> I may be missing something, but I thought the original code had rules >> > for each element of the array? I would certainly expect to see the >> > capability of setting different validating rules for each element, and >> > the rules you are defining are

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 12:18, Peter Lind wrote: > On 12 August 2016 at 13:15, Lester Caine wrote: > >> On 12/08/16 12:09, Peter Lind wrote: >>> And if all typos were switching 'e' and 'n', what a wonderful world it >>> would be. That is not the case though - it's possible to

[PHP-DEV] BAD Benchmark Results for PHP Master 2016-08-12

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

[PHP-DEV] Re: [RFC][DISCUSSION] Add validation functions to filter

2016-08-12 Thread Yasuo Ohgaki
Hi all, On Wed, Aug 3, 2016 at 3:43 PM, Yasuo Ohgaki wrote: > This RFC is to add validation functions and string validation filter. > > https://wiki.php.net/rfc/add_validate_functions_to_filter > > It also allows to define multiple filters for an input. i.e. You can > apply

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Peter Lind
On 12 August 2016 at 13:15, Lester Caine wrote: > On 12/08/16 12:09, Peter Lind wrote: > > And if all typos were switching 'e' and 'n', what a wonderful world it > > would be. That is not the case though - it's possible to accidentally > enter > > " and > too. > And the

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Yasuo Ohgaki
Hi Lester, On Fri, Aug 12, 2016 at 8:13 PM, Yasuo Ohgaki wrote: > On Fri, Aug 12, 2016 at 8:06 PM, Lester Caine wrote: >> On 12/08/16 11:51, Yasuo Ohgaki wrote: >>> What makes you feel missing some or designed badly? >> >> I may be missing something, but

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 12:09, Peter Lind wrote: > And if all typos were switching 'e' and 'n', what a wonderful world it > would be. That is not the case though - it's possible to accidentally enter > " and > too. And the browser validation strips them and handles the ' when used in text fields. -- Lester

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Yasuo Ohgaki
Hi Lester, On Fri, Aug 12, 2016 at 8:06 PM, Lester Caine wrote: > On 12/08/16 11:51, Yasuo Ohgaki wrote: >> What makes you feel missing some or designed badly? > > I may be missing something, but I thought the original code had rules > for each element of the array? I would

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

2016-08-12 Thread Lester Caine
On 12/08/16 10:22, Yasuo Ohgaki wrote: > Hi Lester, > > On Fri, Aug 12, 2016 at 6:12 PM, Lester Caine wrote: >> On 12/08/16 09:23, Yasuo Ohgaki wrote: >>> I don't think it's framework job to do. >> >> This was a little 'tongue in cheek' ... my main thought was simply that >>

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Peter Lind
On 12 August 2016 at 13:01, Lester Caine wrote: > On 12/08/16 11:01, Peter Lind wrote: > > On 12 August 2016 at 11:54, Rowan Collins > wrote: > > > >> On 12/08/2016 10:21, Lester Caine wrote: > >> > >>> Many of my systems run on secure intra-nets and

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Peter Lind
On 12 August 2016 at 12:52, Lester Caine wrote: > On 12/08/16 11:23, Peter Lind wrote: > > On 12 August 2016 at 12:13, Lester Caine wrote: > > > >> On 12/08/16 10:42, Peter Lind wrote: > >>> On 12 August 2016 at 11:25, Lester Caine

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 11:51, Yasuo Ohgaki wrote: > What makes you feel missing some or designed badly? I may be missing something, but I thought the original code had rules for each element of the array? I would certainly expect to see the capability of setting different validating rules for each element,

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 11:01, Peter Lind wrote: > On 12 August 2016 at 11:54, Rowan Collins wrote: > >> On 12/08/2016 10:21, Lester Caine wrote: >> >>> Many of my systems run on secure intra-nets and much of the 'safety >>> concerns' that have been brought up recently as

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 11:23, Peter Lind wrote: > On 12 August 2016 at 12:13, Lester Caine wrote: > >> On 12/08/16 10:42, Peter Lind wrote: >>> On 12 August 2016 at 11:25, Lester Caine wrote: >>> >>> Thanks for the ideas on this feature. >>> >>> A few thoughts. >>>

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Yasuo Ohgaki
Hi Lester, On Fri, Aug 12, 2016 at 7:13 PM, Lester Caine wrote: >> That said, I generally think that built-in methods that accept Callables >> are a great way to go. It encourages reuse through modular composition - >> and could likely be a neater way around the throw

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 11:11, Yasuo Ohgaki wrote: > Hi Lester, > > On Fri, Aug 12, 2016 at 5:19 PM, Lester Caine wrote: >> > I'm thinking >> > $var->setConstraint() >> > $var->setEscape() >> > $var->setReadOnly() > DbC cannot cover all, but some of them can be covered during

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Peter Lind
On 12 August 2016 at 12:13, Lester Caine wrote: > On 12/08/16 10:42, Peter Lind wrote: > > On 12 August 2016 at 11:25, Lester Caine wrote: > > > > Thanks for the ideas on this feature. > > > > A few thoughts. > > 1. The RFC for this isn't a change - it's

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Rowan Collins
On 12/08/2016 10:52, Lester Caine wrote: I think the idea *I* am throwing out for discussion is a switch from global_library($var, ... ) to $var->global_library( ... ) where $var is now always an object without having every framework creating it's own version of the wrapper? So kind of an

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 10:42, Peter Lind wrote: > On 12 August 2016 at 11:25, Lester Caine wrote: > >> On 12/08/16 10:07, Christoph M. Becker wrote: > I'm thinking > $var->setConstraint() > $var->setEscape() > $var->setReadOnly() > > Rather than having to build

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Yasuo Ohgaki
Hi Lester, On Fri, Aug 12, 2016 at 5:19 PM, Lester Caine wrote: > I'm thinking > $var->setConstraint() > $var->setEscape() > $var->setReadOnly() DbC cannot cover all, but some of them can be covered during development. https://wiki.php.net/rfc/introduce_design_by_contract

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Peter Lind
On 12 August 2016 at 11:54, Rowan Collins wrote: > On 12/08/2016 10:21, Lester Caine wrote: > >> Many of my systems run on secure intra-nets and much of the 'safety >> concerns' that have been brought up recently as 'essential' simply don't >> apply. >> > > There's

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Rowan Collins
On 12/08/2016 10:21, Lester Caine wrote: Many of my systems run on secure intra-nets and much of the 'safety concerns' that have been brought up recently as 'essential' simply don't apply. There's always rogue employees / students / visitors with temporary access... But yes, IF you trust your

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 09:54, Rowan Collins wrote: > On 12/08/2016 09:19, Lester Caine wrote: >> I'm thinking >> $var->setConstraint() >> $var->setEscape() >> $var->setReadOnly() >> >> Rather than having to build 'reflections' classes to pull out data that >> a simple $var->is_valid or echo $var will output

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Peter Lind
On 12 August 2016 at 11:25, Lester Caine wrote: > On 12/08/16 10:07, Christoph M. Becker wrote: > >> > I'm thinking > >> > $var->setConstraint() > >> > $var->setEscape() > >> > $var->setReadOnly() > >> > > >> > Rather than having to build 'reflections' classes to pull out

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 09:43, Michał Brzuchalski wrote: > About ReadOnly I'm currently working on `immutable` feature proposal where > could be > possible to mark class and properties as immutable (ReadOnly after > initialisation) > so it could solve problem with ReadOnly ValueObjects and immutable >

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

2016-08-12 Thread Christoph M. Becker
On 11.08.2016 at 12:04, Rowan Collins wrote: > 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

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

2016-08-12 Thread Christoph M. Becker
On 11.08.2016 at 12:04, Rowan Collins wrote: > 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

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 10:07, Christoph M. Becker wrote: >> > I'm thinking >> > $var->setConstraint() >> > $var->setEscape() >> > $var->setReadOnly() >> > >> > Rather than having to build 'reflections' classes to pull out data that >> > a simple $var->is_valid or echo $var will output a correctly escaped >>

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

2016-08-12 Thread Yasuo Ohgaki
Hi Lester, On Fri, Aug 12, 2016 at 6:12 PM, Lester Caine wrote: > On 12/08/16 09:23, Yasuo Ohgaki wrote: >> I don't think it's framework job to do. > > This was a little 'tongue in cheek' ... my main thought was simply that > you need a variable 'session_id' and other

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 09:58, Rowan Collins wrote: >> From a practical point of view of cause, the validation of inputs may >> well be done in the browser so that the constraints get passed TO some >> html5 check, or javascript function. So having uploaded the form one >> COULD simply tag a variable as

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

2016-08-12 Thread Lester Caine
On 12/08/16 09:23, Yasuo Ohgaki wrote: > I don't think it's framework job to do. This was a little 'tongue in cheek' ... my main thought was simply that you need a variable 'session_id' and other processes may benefit from a similarly constrained variable, so an intelligent variable could be

Re: [PHP-DEV] Wiki karma for writing RFC

2016-08-12 Thread Ferenc Kovacs
On Thu, Aug 11, 2016 at 6:05 PM, Michał Brzuchalski wrote: > Hello, > > I would like to submit an RFC for adding object type hint. My wiki account > name is brzuchal. > > Thanks, > -- > Michał Brzuchalski > Hi, I've just granted you with rfc karma for the wiki! --

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Christoph M. Becker
On 12.08.2016 at 10:19, Lester Caine wrote: > On 11/08/16 23:17, Rowan Collins wrote: > >> You've mentioned a lot about flexibility, and that the feature could be >> used in multiple styles, but some concrete examples of how *you* would >> use it might help define what the feature needs to do

Re: [PHP-DEV] RFC Karma

2016-08-12 Thread Ferenc Kovacs
On Tue, Aug 9, 2016 at 1:07 PM, Silvio Marijić wrote: > Hi Internals, > > I would like to create RFC for immutability in PHP which has gone trough > couple of discussions, so I need RFC Karma for that. Michal Brzuchalski and > I will be authors and we will implement it.

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Rowan Collins
On 12/08/2016 08:51, Lester Caine wrote: From a practical point of view of cause, the validation of inputs may well be done in the browser so that the constraints get passed TO some html5 check, or javascript function. So having uploaded the form one COULD simply tag a variable as valid? Just

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Rowan Collins
On 12/08/2016 09:19, Lester Caine wrote: I'm thinking $var->setConstraint() $var->setEscape() $var->setReadOnly() Rather than having to build 'reflections' classes to pull out data that a simple $var->is_valid or echo $var will output a correctly escaped piece of text. Note that as discussed

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Michał Brzuchalski
2016-08-12 10:19 GMT+02:00 Lester Caine : > On 11/08/16 23:17, Rowan Collins wrote: > > You've mentioned a lot about flexibility, and that the feature could be > > used in multiple styles, but some concrete examples of how *you* would > > use it might help define what the

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Michał Brzuchalski
2016-08-12 9:51 GMT+02:00 Lester Caine : > On 12/08/16 03:27, Yasuo Ohgaki wrote: > > It sounds you are looking for autoboxing (or at least something similar) > > > > https://wiki.php.net/rfc/autoboxing > > That is interesting, and is probably something I would expect to come

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

2016-08-12 Thread Yasuo Ohgaki
Hi Lester, On Fri, Aug 12, 2016 at 5:01 PM, Lester Caine wrote: > On 12/08/16 00:20, Yasuo Ohgaki wrote: >> I've missed to handle session.hash_bits_per_character here. There are >> people validating SID (used chars and length) via WAF or PHP code. >>

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 11/08/16 23:17, Rowan Collins wrote: > You've mentioned a lot about flexibility, and that the feature could be > used in multiple styles, but some concrete examples of how *you* would > use it might help define what the feature needs to do (and not do). Currently my code has lots of checks for

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

2016-08-12 Thread Lester Caine
On 12/08/16 00:20, Yasuo Ohgaki wrote: > I've missed to handle session.hash_bits_per_character here. There are > people validating SID (used chars and length) via WAF or PHP code. > session.hash_bits_per_character handling is mandatory for such system. Since 'id' is a variable, isn't this just a

Re: [PHP-DEV] Simple variable handling.

2016-08-12 Thread Lester Caine
On 12/08/16 03:27, Yasuo Ohgaki wrote: > It sounds you are looking for autoboxing (or at least something similar) > > https://wiki.php.net/rfc/autoboxing That is interesting, and is probably something I would expect to come out in the wash with making a more intelligent variable. Except with