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 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 sbj.ml.r...@gmail.com mailto:sbj.ml.r...@gmail.com wrote: 2015-03-19 12:51 GMT+01:00

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 erics...@microsoft.com 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

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 rowan.coll...@gmail.com 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

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] 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 nikita@gmail.com wrote: On Thu, Mar 19, 2015 at 6:49 PM, Zeev Suraski z...@zend.com wrote: On 19 במרץ 2015, at 19:40, Dan Ackroyd dan...@basereality.com wrote: You are being dumb here as well. We try to avoid breaking code in point

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

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 sbj.ml.r...@gmail.com mailto:sbj.ml.r...@gmail.com wrote: 2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki yohg...@ohgaki.net mailto:yohg...@ohgaki.net: Distinguishing array and

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 rowan.coll...@gmail.com 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

[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 yohg...@ohgaki.net 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

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 z...@zend.com 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

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 yohg...@ohgaki.net wrote: On Wed, Mar 18, 2015 at 6:43 PM, Zeev Suraski z...@zend.com 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.

[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

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? (Julien already

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

2015-03-19 Thread Patrick ALLAERT
Hey, Le dim. 15 mars 2015 à 01:54, Niklas Keller m...@kelunik.com 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,

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 yohg...@ohgaki.net: 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

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

[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 yohg...@ohgaki.net 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

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

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. Single.

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 ras...@lerdorf.com 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

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 with this

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: [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 erics...@microsoft.com 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

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

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

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

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 dan...@basereality.com 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

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 franc...@php.net 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 Sara Golemon
On Thu, Mar 19, 2015 at 1:40 PM, Dan Ackroyd dan...@basereality.com wrote: On 19 March 2015 at 17:14, François Laupretre franc...@php.net 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

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 den...@birkholz.biz 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

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 sort

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 z...@zend.com wrote: On 19 במרץ 2015, at 19:40, Dan Ackroyd dan...@basereality.com 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

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 seem to

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 z...@zend.com wrote: On 19 במרץ 2015, at 19:40, Dan Ackroyd dan...@basereality.com 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

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

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 z...@zend.com 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

[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

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 should

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 an

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 den...@birkholz.biz 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,

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 den...@birkholz.biz wrote: Hi, Am 19.03.2015 um 20:26 schrieb Levi Morrison: On Thu, Mar 19, 2015 at 1:05 PM, Dennis Birkholz den...@birkholz.biz wrote: Hi, Am 19.03.2015 um 17:27 schrieb Sebastian B.-Hagensen: Another way to unify array and

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

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

2015-03-19 Thread Alex Bowers
On 19 March 2015 at 21:11, Larry Garfield la...@garfieldtech.com 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

[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

[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),

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

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 la...@garfieldtech.com wrote: On 3/19/15 3:49 PM, Alex

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 yohg...@ohgaki.net: Distinguishing array and callable is problematic. Array callable is better to be deprecated in the long run. IMHO. Then how would

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(...$args); --

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

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 ua.san.a...@gmail.com: 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

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