Re: [PHP-DEV] Simple variable handling.

2016-08-10 Thread Michał Brzuchalski
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 variable with constraint into some object who operates on

Re: [PHP-DEV] Simple variable handling.

2016-08-10 Thread Bishop Bettini
On Wed, Aug 10, 2016 at 4:07 PM, 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 > variables

[PHP-DEV] Re: BC break with rand() where min > max

2016-08-10 Thread Leigh
On Wed, 10 Aug 2016 at 14:19 Tom Worster wrote: > Your fix seems fine for rand() but less so for mt_rand(). > > Applying this fix will break much less mt_rand()-using code than not > applying it will break rand()-using code. From that point of view, > applying it is the better

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Lester Caine
On 10/08/16 20:55, Stanislav Malyshev wrote: > So in my opinion we should not be callous about the "never upgrade" > option - because right now it's what a very sizeable part of the > community already doing, and IMO this is *our* problem, not *theirs*. I set up http://phpsurgery.org/ a few years

[PHP-DEV] Simple variable handling.

2016-08-10 Thread Lester Caine
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 variables that are the heart of PHP. validate_var_array() is a case in point, since ALL it

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Lester Caine
On 10/08/16 20:36, Peter Lind wrote: >>From what i can tell, Lester has an infrastructure problem. Not a PHP > problem. But he still wants to halt language development so the community > doesn't pick up new features that might make problems in his code. That > does not seem reasonable to me. Yes

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Stanislav Malyshev
Hi! > EVERYTHING is a barrier to moving your code forward. You tell the mailing > this on a regular basis. > Perhaps you should just migrate your 15+ year old code already and be done > with it? I would like to note two things here: 1. We have a very diverse community and people have a lot of

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

2016-08-10 Thread Christoph M. Becker
On 10.08.2016 at 13:38, Kalle Sommer Nielsen wrote: > 2016-08-10 12:59 GMT+02:00 Nikita Popov : >> On Wed, Aug 10, 2016 at 12:52 PM, Christoph M. Becker >> wrote: >> The simplest way to fix ext/xml in particular is probably to migrate it to >> use an

Re: [PHP-DEV] SQLite 3.14

2016-08-10 Thread Christoph M. Becker
On 10.08.2016 at 20:51, Rasmus Schultz wrote: > On Wed, Aug 10, 2016 at 4:08 PM, Christoph M. Becker > wrote: > >> Sounds reasonable, Anotol. Thanks. So I'm going to update 7.1+ ASAP. > > Are you going to include any plugins? > > I noticed today, SQLite has interesting

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Peter Lind
On 10 Aug 2016 19:05, "Bishop Bettini" wrote: > > On Wed, Aug 10, 2016 at 5:37 AM, Peter Lind wrote: >> >> On 10 August 2016 at 10:51, Lester Caine wrote: >> >> > On 09/08/16 06:54, Sara Golemon wrote: >> > > On Mon, Aug 8, 2016 at

Re: [PHP-DEV] SQLite 3.14

2016-08-10 Thread Rasmus Schultz
On Wed, Aug 10, 2016 at 4:08 PM, Christoph M. Becker wrote: > Sounds reasonable, Anotol. Thanks. So I'm going to update 7.1+ ASAP. Are you going to include any plugins? I noticed today, SQLite has interesting optional features - in particular, the "json1" plug-in looks

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

2016-08-10 Thread Michał Brzuchalski
Maybe it's a good idea to move them to another ext, and then move xmlparser back to PECL ? 2016-08-10 20:23 GMT+02:00 Christoph M. Becker : > On 10.08.2016 at 19:34, Fleshgrinder wrote: > > > On 8/10/2016 4:17 PM, Christoph M. Becker wrote: > >> On 10.08.2016 at 12:59, Nikita

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

2016-08-10 Thread Christoph M. Becker
On 10.08.2016 at 19:34, Fleshgrinder wrote: > On 8/10/2016 4:17 PM, Christoph M. Becker wrote: >> On 10.08.2016 at 12:59, Nikita Popov wrote: >> >>> The simplest way to fix ext/xml in particular is probably to migrate it to >>> use an object instead of a resource. >> >> I guess that is the best

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Fleshgrinder
> On 09/08/2016 21:26, Fleshgrinder wrote: >> An alternative approach could be to auto-load only namespaced >> things and leave non-namespaced stuff alone. > > It's not quite as simple as that, as examples have already shown. > > # file a.php namespace Acme\Foo; function a() { return 'Hello >

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

2016-08-10 Thread Fleshgrinder
On 8/10/2016 4:17 PM, Christoph M. Becker wrote: > On 10.08.2016 at 12:59, Nikita Popov wrote: > >> The simplest way to fix ext/xml in particular is probably to migrate it to >> use an object instead of a resource. > > I guess that is the best action in the long run (i.e. 7.2+), but that > would

Re: [PHP-DEV] Namespaces internal refactoring

2016-08-10 Thread Fleshgrinder
The current approach to namespaces blocks new features like you see it in the following PR. The link already points to the two most relevant comments that should give you full context: https://github.com/php/php-src/pull/947/#issuecomment-224912697 You might know other approaches to solve this.

Re: [PHP-DEV] Re: The death of `#ifndef FAST_ZPP`?

2016-08-10 Thread Andrea Faulds
Hi Yasuo, Yasuo Ohgaki wrote: I've asked the same question before I start eliminating old style parse API. Dimitry said it's designed to optimize heavily called functions, not for ease of use and the RFC for fast zpp states "keep old parameter parsing API", so I don't have to bother. Oh,

Re: [PHP-DEV] Re: The death of `#ifndef FAST_ZPP`?

2016-08-10 Thread Fleshgrinder
On 8/10/2016 4:23 AM, Andrea Faulds wrote: > Hi everyone, > > 3 months and 6 days on, nobody has responded to this. > > Will these chunks of dead code ever be removed? > > Thanks! > > Andrea Faulds wrote: > +1 from my side, if it's faster it's faster. :) -- Richard "Fleshgrinder"

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Bishop Bettini
On Wed, Aug 10, 2016 at 5:37 AM, Peter Lind wrote: > On 10 August 2016 at 10:51, Lester Caine wrote: > > > On 09/08/16 06:54, Sara Golemon wrote: > > > On Mon, Aug 8, 2016 at 9:59 PM, Lester Caine > wrote: > > >> So Composer IS

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

2016-08-10 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-08-10 06:23:04+03:00 commit: f41b69e previous commit:a5bec3a revision date: 2016-08-09 18:18:32+00: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] array_search "all" value (not only the first one)

2016-08-10 Thread Remi Collet
Le 10/08/2016 à 15:58, Nikita Popov a écrit : > On Wed, Aug 10, 2016 at 3:37 PM, Remi Collet > wrote: > > I think this is a small missing feature. > > > Comment welcome on https://github.com/php/php-src/pull/2071 >

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

2016-08-10 Thread Christoph M. Becker
On 10.08.2016 at 12:59, Nikita Popov wrote: > On Wed, Aug 10, 2016 at 12:52 PM, Christoph M. Becker > wrote: >> >> I've tried to fix , and it looks like >> there's a general GC issue wrt. to resources referencing objects and >> vice versa. Aren't

Re: [PHP-DEV] SQLite 3.14

2016-08-10 Thread Christoph M. Becker
On 10.08.2016 at 16:01, Anatol Belski wrote: > Hi Christoph, > >> -Original Message- >> From: Christoph M. Becker [mailto:cmbecke...@gmx.de] >> Sent: Monday, August 8, 2016 11:23 PM >> To: internals@lists.php.net; Anatol Belski >> Subject: [PHP-DEV] SQLite 3.14 >>

RE: [PHP-DEV] SQLite 3.14

2016-08-10 Thread Anatol Belski
Hi Christoph, > -Original Message- > From: Christoph M. Becker [mailto:cmbecke...@gmx.de] > Sent: Monday, August 8, 2016 11:23 PM > To: internals@lists.php.net; Anatol Belski > Subject: [PHP-DEV] SQLite 3.14 > > Hi! > > SQLite 3.14 has been released today. It

Re: [PHP-DEV] array_search "all" value (not only the first one)

2016-08-10 Thread Nikita Popov
On Wed, Aug 10, 2016 at 3:37 PM, Remi Collet wrote: > I think this is a small missing feature. > > > Comment welcome on https://github.com/php/php-src/pull/2071 > > > (don't know if such a small self-contained change need a RFC). > > > Remi. > > Hi, how does this differ

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Lester Caine
On 10/08/16 12:14, Michał Brzuchalski wrote: > @Peter and @Rowan: Very good point and sounds reasonable, I also thing > there is need for evolution. Idea of fork PHP and never update made me > laugh to tears :) To be quite honest ... I do now wish that I had simply forked PHP5.3 and maintained

[PHP-DEV] array_search "all" value (not only the first one)

2016-08-10 Thread Remi Collet
I think this is a small missing feature. Comment welcome on https://github.com/php/php-src/pull/2071 (don't know if such a small self-contained change need a RFC). Remi. signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] username: shaficsebd

2016-08-10 Thread Michał Brzuchalski
It doesn't look like base64_*'s responsibility at all. Those global functions should be just encoder and decoder and notbing yo do with security! 10.08.2016 3:24 PM "Kalle Sommer Nielsen" napisał(a): > On Aug 10, 2016 15:15, "Shafi Upwork" wrote: > > > > I

Re: [PHP-DEV] username: shaficsebd

2016-08-10 Thread Kalle Sommer Nielsen
On Aug 10, 2016 15:15, "Shafi Upwork" wrote: > > I was working Base64 Decode and Encode > I realize how it could be if we add a password with it? > we use > > $string = 'i am trying to do something'; > $encode = base64_encode($string ,'mypassword'); > > $decode =

[PHP-DEV] Re: BC break with rand() where min > max

2016-08-10 Thread Tom Worster
On 8/8/16 5:36 PM, Leigh wrote: Hi all, There has been an unforeseen break with rand() when the minimum value is greater than the maximum. Prior to 7.1 rand() would happily accept backwards parameters and return a value, however in the 7.1 branch it now emits a warning and returns false. I've

[PHP-DEV] username: shaficsebd

2016-08-10 Thread Shafi Upwork
I was working Base64 Decode and Encode I realize how it could be if we add a password with it? we use $string = 'i am trying to do something'; $encode = base64_encode($string ,'mypassword'); $decode = base64_decode($str, 'mypassword'); so if password match then we will get result or not.. just

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

2016-08-10 Thread Kalle Sommer Nielsen
2016-08-10 12:59 GMT+02:00 Nikita Popov : > On Wed, Aug 10, 2016 at 12:52 PM, Christoph M. Becker > wrote: > The simplest way to fix ext/xml in particular is probably to migrate it to > use an object instead of a resource. > > Nikita If my memory strikes

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Michał Brzuchalski
@Peter and @Rowan: Very good point and sounds reasonable, I also thing there is need for evolution. Idea of fork PHP and never update made me laugh to tears :) 2016-08-10 11:42 GMT+02:00 Rowan Collins : > On 10/08/2016 09:51, Lester Caine wrote: > >> There is not a

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

2016-08-10 Thread Yasuo Ohgaki
Hi Marco, On Wed, Aug 10, 2016 at 6:32 PM, Marco Pivetta wrote: > > Something is weird with the voting form, can you check it? Thank you for letting me know! I rewrited vote section immediately after I posted RFC vote notice mail because it wasn't working for some reason.

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

2016-08-10 Thread Nikita Popov
On Wed, Aug 10, 2016 at 12:52 PM, Christoph M. Becker wrote: > Hi! > > I've tried to fix , and it looks like > there's a general GC issue wrt. to resources referencing objects and > vice versa. Aren't resource ZVALS put in the root buffer? > > See

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

2016-08-10 Thread Christoph M. Becker
Hi! I've tried to fix , and it looks like there's a general GC issue wrt. to resources referencing objects and vice versa. Aren't resource ZVALS put in the root buffer? See , which demonstrates the issue better than the test script in the bug

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

2016-08-10 Thread Yasuo Ohgaki
Hi all, On Wed, Aug 10, 2016 at 7:03 PM, Yasuo Ohgaki wrote: > It requires a lot less user code > > session_rengenerate_id('myprefix-'); > > yet it is safe. I forgot to mention important requirement. It is safe when 'session.use_strict_mode=1'. Unfortunately, RFC for

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

2016-08-10 Thread Yasuo Ohgaki
Hi Marco, On Wed, Aug 10, 2016 at 6:31 PM, Marco Pivetta wrote: > The RFC mentions "Without session_create_id(), user has to implement their > own bin_to_readable() in user land.". > This pretty much makes it clear that a userland implementation is feasible, > and thus it

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Rowan Collins
On 10/08/2016 09:51, Lester Caine wrote: There is not a 'single solution' that will fit the vast range of users of PHP but current targeting seems to be aimed at a subset of both coding style and practice at the expense of perfectly safe and functional existing code. This entire thread is

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Peter Lind
On 10 August 2016 at 10:51, Lester Caine wrote: > On 09/08/16 06:54, Sara Golemon wrote: > > On Mon, Aug 8, 2016 at 9:59 PM, Lester Caine wrote: > >> So Composer IS now the rule rather than some optional extra? > >> > > Yes, the community has decided that

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

2016-08-10 Thread Marco Pivetta
Hey Yasuo, Something is weird with the voting form, can you check it? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Wed, Aug 10, 2016 at 11:30 AM, Yasuo Ohgaki wrote: > Hi all, > > This RFC is to add session_gc() function. > > session_gc()

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

2016-08-10 Thread Marco Pivetta
Hello, The RFC mentions "Without session_create_id(), user has to implement their own bin_to_readable() in user land.". This pretty much makes it clear that a userland implementation is feasible, and thus it should indeed be implemented in userland when possible. That's my reasoning for voting

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

2016-08-10 Thread Yasuo Ohgaki
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 requires 2/3 majority to pass. Vote starts: 2016/08/10 - Vote ends: 2016/08/17 23:59:59 UTC

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

2016-08-10 Thread Yasuo Ohgaki
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 module does. It also validates and makes sure generated session ID string has no

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Stanislav Malyshev
Hi! > Having the use statement trigger the auto-loader would result in a lot > of broken code because of optional dependencies (remember the examples I > showed you in the annotation thread). I think it's not a good idea in general. use statement right now is basically a syntax sugar - you just

Re: [PHP-DEV] Function auto-loading

2016-08-10 Thread Lester Caine
On 09/08/16 06:54, Sara Golemon wrote: > On Mon, Aug 8, 2016 at 9:59 PM, Lester Caine wrote: >>> That is, when I'm running the test-suite of my package, the Composer >>> project is the root folder of that package - but when the package is >>> being consumed by another project,

Re: [PHP-DEV] Namespaces internal refactoring

2016-08-10 Thread Stanislav Malyshev
Hi! > It is. > > I agree with your thoughts. > Back in 2008, namespaces were designed and added to PHP 5.3 as just > substrings in class names. That is correct (except that namespaces first appeared in 2007, first commit f32ffe9b430b718628f868e449c1fcbdc8ec9ef6 if you're interested, of course