Re: [PHP-DEV] [Q] Does PHP have a negative cache for file stat operations?

2015-03-19 Thread Stanislav Malyshev
Hi! > We're doing some performance work in WinCache, and we're finding that > some frameworks are...uh...enthusiastically using file_exists(), > is_file() and is_dir() functions on files/directories that don't > exist. Every. Single. Pageload. > > Does the PHP stat cache include negative cache e

[PHP-DEV] Re: Bug #69127 session_regenerate_id(true) randomly generates awarning and loses session data

2015-03-19 Thread Christoph Becker
Yasuo Ohgaki wrote: > On Sun, Mar 1, 2015 at 1:53 PM, Yasuo Ohgaki wrote: > >> There are too many things that I would like to improve ;) >> >> https://bugs.php.net/bug.php?id=69127 >> >> This bug is known fatal bug for session module. I proposed "lazy_destroy" >> to fix >> this before, but it de

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Pierre Joye
On Fri, Mar 20, 2015 at 1:21 PM, François Laupretre wrote: > May I also add that it is not the first time people raise concerns about RFCs > when vote starts. On different occasions, it was clear that most had not read > the RFC before the vote was announced. I even have two RFCs which were > p

Re: [PHP-DEV] [Q] Does PHP have a negative cache for file stat operations?

2015-03-19 Thread Dan Ackroyd
On 19 March 2015 at 20:26, Eric Stenson wrote: > PHP Internals folks-- > > We're doing some performance work in WinCache, and we're finding that some > frameworks > are...uh...enthusiastically using file_exists(), is_file() and is_dir() > functions on > files/directories that don't exist. Every

RE: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread François Laupretre
May I also add that it is not the first time people raise concerns about RFCs when vote starts. On different occasions, it was clear that most had not read the RFC before the vote was announced. I even have two RFCs which were planned for 7.0 and won't be in because I had to stop the vote and re

RE: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread François Laupretre
> De : Dan Ackroyd [mailto:dan...@basereality.com] > > On 19 March 2015 at 17:14, François Laupretre wrote: > > > As you may have noticed if you had a look at the RFC or twitter, I have > decided to follow people's suggestion. > > Please note that the switch from E_DEPRECATED to fatal error won'

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Alex Bowers
> > I'm not sure why it would duplicate the item like that. My interpretation > of $array[$start:$end] would be "an array containing all those elements of > $array with a position more than or equal to $start, but less than or equal > to $end" ($position >= $start && $position <= $end). > I agree

Re: [PHP-DEV] [Q] Does PHP have a negative cache for file stat operations?

2015-03-19 Thread Pierre Joye
On Fri, Mar 20, 2015 at 12:09 PM, Rasmus Lerdorf wrote: > On 03/19/2015 01:26 PM, Eric Stenson wrote: >> PHP Internals folks-- >> >> We're doing some performance work in WinCache, and we're finding that some >> frameworks are...uh...enthusiastically using file_exists(), is_file() and >> is_dir()

Re: [PHP-DEV] [Q] Does PHP have a negative cache for file stat operations?

2015-03-19 Thread Rasmus Lerdorf
On 03/19/2015 01:26 PM, Eric Stenson wrote: > PHP Internals folks-- > > We're doing some performance work in WinCache, and we're finding that some > frameworks are...uh...enthusiastically using file_exists(), is_file() and > is_dir() functions on files/directories that don't exist. Every. Singl

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Rowan Collins
On 19/03/2015 23:55, Alex Bowers wrote: Thats a good point, something else that just came to me; your example of $countdown[0:0]; if we had it as inclusive indexes, then this would actually give you ['Five!', 'Five!'], which is unlikely to be what was desired. I'm not sure why it would dupli

[PHP-DEV] Re: Bug #69127 session_regenerate_id(true) randomly generates a warning and loses session data

2015-03-19 Thread Yasuo Ohgaki
Hi all, On Sun, Mar 1, 2015 at 1:53 PM, Yasuo Ohgaki wrote: > There are too many things that I would like to improve ;) > > https://bugs.php.net/bug.php?id=69127 > > This bug is known fatal bug for session module. I proposed "lazy_destroy" > to fix > this before, but it declined. > > I think the

Re: [PHP-DEV] [Q] Does PHP have a negative cache for file stat operations?

2015-03-19 Thread Pierre Joye
On Fri, Mar 20, 2015 at 7:26 AM, Eric Stenson wrote: > PHP Internals folks-- > > We're doing some performance work in WinCache, and we're finding that some > frameworks are...uh...enthusiastically using file_exists(), is_file() and > is_dir() functions on files/directories that don't exist. Eve

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Pierre Joye
On Fri, Mar 20, 2015 at 5:04 AM, Nikita Popov wrote: > On Thu, Mar 19, 2015 at 6:49 PM, Zeev Suraski wrote: > >> > On 19 במרץ 2015, at 19:40, Dan Ackroyd wrote: >> > >> > You are being dumb here as well. We try to avoid breaking code in >> > point releases. This BC break can only be done at a ma

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Yasuo Ohgaki
Hi Rowan, On Fri, Mar 20, 2015 at 8:00 AM, Rowan Collins wrote: > I had no intention of restricting the discussion in any way, apologies if > it came across that way. > > Perhaps what I should have said is it is not *only* time that is needed - > we need to design the replacement before it's wor

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Alex Bowers
On 19 March 2015 at 23:23, Rowan Collins wrote: > On 19/03/2015 20:49, Alex Bowers wrote: > >> My proposal is something similar to Pythons slice, in PHP this would look >> like: >> >> $slided = $array[1:4] >> >> This will get the elements in positions 1,2,3,4. (1 through 4 inclusive), >> ignoring

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Rowan Collins
On 19/03/2015 20:49, Alex Bowers wrote: My proposal is something similar to Pythons slice, in PHP this would look like: $slided = $array[1:4] This will get the elements in positions 1,2,3,4. (1 through 4 inclusive), ignoring the actual key of the array. The result for an array will be an array

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Rowan Collins
On 19/03/2015 22:43, Yasuo Ohgaki wrote: Hi Rowan, On Fri, Mar 20, 2015 at 7:12 AM, Rowan Collins mailto:rowan.coll...@gmail.com>> wrote: On 19/03/2015 20:50, Yasuo Ohgaki wrote: Hi Sebastian, On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen mailto:sbj.ml.r

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Dennis Birkholz
Am 19.03.2015 um 22:11 schrieb Levi Morrison: > On Thu, Mar 19, 2015 at 1:44 PM, Dennis Birkholz wrote: >> Hi, >> >> Am 19.03.2015 um 20:26 schrieb Levi Morrison: >>> On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz >>> wrote: Hi, Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagens

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Yasuo Ohgaki
Hi Rowan, On Fri, Mar 20, 2015 at 7:12 AM, Rowan Collins wrote: > On 19/03/2015 20:50, Yasuo Ohgaki wrote: > >> Hi Sebastian, >> >> On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen < >> sbj.ml.r...@gmail.com > wrote: >> >> 2015-03-19 12:51 GMT+01:00 Yasuo

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Rowan Collins
On 19/03/2015 20:50, Yasuo Ohgaki wrote: Hi Sebastian, On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen mailto:sbj.ml.r...@gmail.com>> wrote: 2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki mailto:yohg...@ohgaki.net>>: > Distinguishing array and callable is problematic. > Array call

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Alex Bowers
On 19 March 2015 at 21:11, Larry Garfield wrote: > On 3/19/15 4:06 PM, Alex Bowers wrote: > >> I've had a quick scan of the list at https://wiki.php.net/rfc but cannot >> seem to find anything. I'll read more carefully through, or is there a >> different list elsewhere which I should look at? >>

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Larry Garfield
On 3/19/15 4:06 PM, Alex Bowers wrote: I've had a quick scan of the list at https://wiki.php.net/rfc but cannot seem to find anything. I'll read more carefully through, or is there a different list elsewhere which I should look at? Not everything makes it to an RFC. This list's archives are qu

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Levi Morrison
On Thu, Mar 19, 2015 at 1:44 PM, Dennis Birkholz wrote: > Hi, > > Am 19.03.2015 um 20:26 schrieb Levi Morrison: >> On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz wrote: >>> Hi, >>> >>> Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen: Another way to unify array and string callback may

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Alex Bowers
I've had a quick scan of the list at https://wiki.php.net/rfc but cannot seem to find anything. I'll read more carefully through, or is there a different list elsewhere which I should look at? On 19 March 2015 at 21:03, Larry Garfield wrote: > On 3/19/15 3:49 PM, Alex Bowers wrote: > >> This em

Re: [PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Larry Garfield
On 3/19/15 3:49 PM, Alex Bowers wrote: This email is just to gauge the response for some syntactic sugar to be added to PHP in regard to slicing an array. My proposal is something similar to Pythons slice, in PHP this would look like: $slided = $array[1:4] This will get the elements in positio

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Yasuo Ohgaki
Hi Sebastian, On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen < sbj.ml.r...@gmail.com> wrote: > 2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki : > > Distinguishing array and callable is problematic. > > Array callable is better to be deprecated in the long run. IMHO. > > Then how would you write

[PHP-DEV] RFC - Array slice syntactic sugar

2015-03-19 Thread Alex Bowers
This email is just to gauge the response for some syntactic sugar to be added to PHP in regard to slicing an array. My proposal is something similar to Pythons slice, in PHP this would look like: $slided = $array[1:4] This will get the elements in positions 1,2,3,4. (1 through 4 inclusive), igno

[PHP-DEV] [Q] Does PHP have a negative cache for file stat operations?

2015-03-19 Thread Eric Stenson
PHP Internals folks-- We're doing some performance work in WinCache, and we're finding that some frameworks are...uh...enthusiastically using file_exists(), is_file() and is_dir() functions on files/directories that don't exist. Every. Single. Pageload. Does the PHP stat cache include negativ

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Dennis Birkholz
Hi, Am 19.03.2015 um 20:26 schrieb Levi Morrison: > On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz wrote: >> Hi, >> >> Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen: >>> Another way to unify array and string callback may be to use the >>> callable syntax and have it return a closure: >>>

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Levi Morrison
On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz wrote: > Hi, > > Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen: >> Another way to unify array and string callback may be to use the >> callable syntax and have it return a closure: >> callable('strlen'); >> callable($object, $methodName); >>

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Stanislav Malyshev
Hi! >> As you may have noticed if you had a look at the RFC or twitter, I have >> decided to follow people's suggestion. >> Please note that the switch from E_DEPRECATED to fatal error won't require >> any new RFC/discussion/vote >> as the fatal error is considered as approved. I just introduce

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Dennis Birkholz
Hi, Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen: > Another way to unify array and string callback may be to use the > callable syntax and have it return a closure: > callable('strlen'); > callable($object, $methodName); > callable('class', 'staticMethod') but before that happens, we shou

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Rowan Collins
Dan Ackroyd wrote on 19/03/2015 18:11: Rowan wrote: >you should pause, make a cup of tea, and redraft the e-mail. That was the redrafted version. And yet it still accused another contributor of "being dumb", and demanded they have access revoked. That is not a respectful or proportional res

Re: [PHP-DEV] Voting irregularities

2015-03-19 Thread Christoph Becker
Levi Morrison wrote: >> Whatever you want to improve, please consider that the PHP wiki is >> driven by DokuWiki which needs to get updated from time to time (lately >> there have been two updates every year[1]; this is not accounting any >> necessary updates to DokuWiki plugins). These updates s

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Dan Ackroyd
Hi Zeev, On 19 March 2015 at 17:49, Zeev Suraski wrote: > Technically, we're not allowed to move from from a working feature into a > removed one without a deprecation phase. Please can you point me to where this is written down? Please also show me where it says that this rule cannot be over-r

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Nikita Popov
On Thu, Mar 19, 2015 at 6:49 PM, Zeev Suraski wrote: > > On 19 במרץ 2015, at 19:40, Dan Ackroyd wrote: > > > > You are being dumb here as well. We try to avoid breaking code in > > point releases. This BC break can only be done at a major version. > > Technically, we're not allowed to move from

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Levi Morrison
On Thu, Mar 19, 2015 at 11:49 AM, Zeev Suraski wrote: >> On 19 במרץ 2015, at 19:40, Dan Ackroyd wrote: >> >> You are being dumb here as well. We try to avoid breaking code in >> point releases. This BC break can only be done at a major version. > > Technically, we're not allowed to move from from

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Sara Golemon
On Thu, Mar 19, 2015 at 1:40 PM, Dan Ackroyd wrote: > On 19 March 2015 at 17:14, François Laupretre wrote: > >> As you may have noticed if you had a look at the RFC or twitter, I have >> decided to follow people's suggestion. >> Please note that the switch from E_DEPRECATED to fatal error won't

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Rowan Collins
Dan Ackroyd wrote on 19/03/2015 17:40: On 19 March 2015 at 17:14, François Laupretre wrote: As you may have noticed if you had a look at the RFC or twitter, I have decided to follow people's suggestion. Please note that the switch from E_DEPRECATED to fatal error won't require any new RFC/di

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Zeev Suraski
> On 19 במרץ 2015, at 19:40, Dan Ackroyd wrote: > > You are being dumb here as well. We try to avoid breaking code in > point releases. This BC break can only be done at a major version. Technically, we're not allowed to move from from a working feature into a removed one without a deprecation

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Levi Morrison
> There's then the question of what kind of object it would return - a > Closure? Some child or sibling of Closure? What methods could be usefully > provided? Yes, it's a closure. I've actually fleshed this out quite a bit, and there are a few important questions: - With methods do you allow unb

Re: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Dan Ackroyd
On 19 March 2015 at 17:14, François Laupretre wrote: > As you may have noticed if you had a look at the RFC or twitter, I have > decided to follow people's suggestion. > Please note that the switch from E_DEPRECATED to fatal error won't require > any new RFC/discussion/vote > as the fatal erro

RE: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread Pierre Joye
On Mar 20, 2015 12:14 AM, "François Laupretre" wrote: > > > De : Zeev Suraski [mailto:z...@zend.com] > > > > https://wiki.php.net/rfc/array-to-string (which I voted yes to) deviates > > from our guidelines of deprecating features first, and removing them > > later; It’s addressed in the RFC – but

RE: [PHP-DEV] Question/comment about the Array to String conversion RFC

2015-03-19 Thread François Laupretre
> De : Zeev Suraski [mailto:z...@zend.com] > > https://wiki.php.net/rfc/array-to-string (which I voted yes to) deviates > from our guidelines of deprecating features first, and removing them > later; It’s addressed in the RFC – but I’m a bit worried that this opens > the door to jumping from any s

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Rowan Collins
Sebastian B.-Hagensen wrote on 19/03/2015 16:27: Another way to unify array and string callback may be to use the callable syntax and have it return a closure: callable('strlen'); callable($object, $methodName); callable('class', 'staticMethod') Andrea proposed a slightly different syntax for f

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Sebastian B.-Hagensen
Hi, 2015-03-19 17:17 GMT+01:00 S.A.N : >> Then how would you write an callback containing an already constructed >> object? >> $a = [$object, 'method']; >> >> The alternative is unnecessarily cumbersome: >> $a = function($methodArg1, $methodArg2) use($object) { return >> $object->method($methodArg

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Patrick Schaaf
On Thursday 19 March 2015 18:17:50 S.A.N wrote: > > Then how would you write an callback containing an already constructed > > object? $a = [$object, 'method']; > > > > The alternative is unnecessarily cumbersome: > > $a = function($methodArg1, $methodArg2) use($object) { return > > $object->metho

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread S.A.N
> Then how would you write an callback containing an already constructed object? > $a = [$object, 'method']; > > The alternative is unnecessarily cumbersome: > $a = function($methodArg1, $methodArg2) use($object) { return > $object->method($methodArg1, $methodArg2); }; $object->$methodName(...$arg

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Vik Hudec
I've always liked how callbacks (well, function pointers) are handled in C - using the function name without parentheses. eg. $a = $object->method; But this wouldn't work in PHP as is, since property and method names would collide. How do people feel about the fact that we have separate propert

[PHP-DEV] WIKI Account Request

2015-03-19 Thread Mike Willbanks
Hello Internals, I had requested a wiki account (mwillbanks) as I would like to propose an RFC on Object casts to scalar types. This has previously been discussed prior to scalar type hints and since we have those now coming into PHP 7, I believe it would be a great time to take a look at this fo

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Sebastian B.-Hagensen
Hi, 2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki : > Distinguishing array and callable is problematic. > Array callable is better to be deprecated in the long run. IMHO. Then how would you write an callback containing an already constructed object? $a = [$object, 'method']; The alternative is unneces

Re: [PHP-DEV] Inconsistencies in callable, call_user_func and direct variable calls

2015-03-19 Thread Yasuo Ohgaki
Hi all, On Sun, Mar 15, 2015 at 7:15 PM, Nicolas Grekas < nicolas.grekas+...@gmail.com> wrote: > > >> Foo::bar(); // OK > > >> ['Foo', 'bar'](); // OK > > >> 'Foo::bar'(); // FATAL ERROR > > > > Hi, > > does this topic need to be addressed before PHP7 goes feature freeze? Or is > it a bugfix? (Ju

Re: [PHP-DEV] [RFC][PRE-VOTE] In Operator

2015-03-19 Thread Patrick ALLAERT
Hey, Le dim. 15 mars 2015 à 01:54, Niklas Keller a écrit : > Morning, > > I'd like to announce that I'll open the vote for the in operator later > that day. > You can find the RFC here: https://wiki.php.net/rfc/in_operator > > There was a small change: If the haystack is a string, integers are n

Re: [PHP-DEV] [RFC][Accepted] Scalar Type Declarations V0.5

2015-03-19 Thread Yasuo Ohgaki
Hi all, On Thu, Mar 19, 2015 at 6:37 PM, Yasuo Ohgaki wrote: > On Wed, Mar 18, 2015 at 6:43 PM, Zeev Suraski wrote: > >> > FWIW, as someone who did play with the patch (both patches, of course), >> > I'm not sure why people are claiming you don't understand the RFC. Your >> > comments in the c

Re: [PHP-DEV] [RFC][Accepted] Scalar Type Declarations V0.5

2015-03-19 Thread Yasuo Ohgaki
Hi Zeev, On Wed, Mar 18, 2015 at 6:43 PM, Zeev Suraski wrote: > > FWIW, as someone who did play with the patch (both patches, of course), > > I'm not sure why people are claiming you don't understand the RFC. Your > > comments in the code are 100% accurate, which means you understood > > exactl

[PHP-DEV] new wiki account / requesting RFC karma

2015-03-19 Thread Patrick Schaaf
Dear internals, I just registered my own php.net account, username "bof". This is the obligatory introduction mail I'm supposed to send :) TL;DR: I think I know what I'm doing, and currently I'm requesting RFC karma. I'm mainly working as a system administrator. As part of my job I'm supporting