Re: [PHP-DEV] [VOTE] Make empty() a Variadic

2015-03-12 Thread Crypto Compress
Am 12.03.2015 um 20:42 schrieb Thomas Punt: The only compromise I can think of (though not sure on its feasibility) would be to have a flag as the last parameter that defaulted to logically AND'ing its args with the ability to switch the semantics to logically OR the args. Hello Thomas, how a

Re: [PHP-DEV] static constructor

2015-03-12 Thread Crypto Compress
Hello Johannes, in other mails you argue with Rowan about global state. I think it's better to focus on innovation of "class context" in global scope, as it's impossible to reason the disadvantages of global state away. (Discussions on variable scope are painful too.) And two questions: 1. B

Re: [PHP-DEV] [RFC] Basic Scalar Types

2015-03-12 Thread Andi Gutmans
> On Mar 11, 2015, at 2:28 PM, Bob Weinand wrote: > > Hi all, > > after all, some people are not happy with the current proposals about scalar > types. So, they both still possibly may fail. > > Thus, I'd like to come up with a fallback proposal in case both proposals > fail: > > https://wi

[PHP-DEV] Drop Multiply VM kind support

2015-03-12 Thread Xinchen Hui
Hey: We have CALL SWITCH GOTO vm kind supports for long time. And we use CALL for default. SWITCH GOTO seems useless now, and brings us some troubles while maintaining . And also could make some extension unable to work, like in phpdbg: PHPDBG_G(vmret) = execu

Re: [PHP-DEV] static constructor

2015-03-12 Thread Christoph Becker
Johannes Ott wrote: > And i although see no DI or Singleton pattern to use here to get the > same functionality, if you want to use like Config::getHostname() and > not like Config::getInstance()->getHostname() which is really > unnecessary abstraction level for nothing in my opinion! It is possi

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
Am 12.03.2015 um 21:33 schrieb Rowan Collins: > Johannes Ott wrote on 12/03/2015 19:45: >> All of the magic methods are doing like this. > > I thought you might say that, but the only thing remotely similar I can > think of is a destructor, which gets called when an object goes out of > scope; t

Re: [PHP-DEV] [RFC][VOTE] Scalar Type Declarations v0.5

2015-03-12 Thread Pascal Martin, AFUP
Le 26/02/2015 15:58, Anthony Ferrara a écrit : I have opened voting on Scalar Type Declarations v0.5. Please cast your vote. Hi, We were, at AFUP, +1 for the v0.3 of this RFC, and it seems we still are on the +1 side for this v0.5 Thanks for having re-vived this! -- Pascal MARTIN, AFUP - Fr

Re: [PHP-DEV] static constructor

2015-03-12 Thread Rowan Collins
Johannes Ott wrote on 12/03/2015 19:45: All of the magic methods are doing like this. I thought you might say that, but the only thing remotely similar I can think of is a destructor, which gets called when an object goes out of scope; the others are all the implementation of, or instead of

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
Am 12.03.2015 um 20:34 schrieb Rowan Collins: > Patrick Schaaf wrote on 12/03/2015 18:40: >> >> Am 12.03.2015 18:56 schrieb "Rowan Collins" > >: >> > >> > Johannes Ott wrote on 12/03/2015 17:05: >> > >> So doing a null check each time >> is a overhead of ca

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
Am 12.03.2015 um 18:55 schrieb Rowan Collins: > Johannes Ott wrote on 12/03/2015 17:05: >> Am 12.03.2015 um 16:57 schrieb Rowan Collins: >>> Johannes Ott wrote on 12/03/2015 14:51: That is nearly like initializing a class constant, but in my opinion a constant should not have a "complex"

RE: [PHP-DEV] [VOTE] Make empty() a Variadic

2015-03-12 Thread Thomas Punt
Hey Derick, > IMO, because it's not obvious whether it is *all* empty, or *atleast > one* empty. The same argument we had before, when we expanded isset() to > be variadic. We had the same discussion then, resulting on keeping > empty() as it is. > > One discussion 11 years ago: > http://marc.info

RE: [PHP-DEV] [VOTE] Make empty() a Variadic

2015-03-12 Thread Thomas Punt
Hey Dan, >> The falsy semantics of empty() means that inlining its behaviour to exactly >> match >> isset() isn't logical. > > The problem isn't so much that the behaviour doesn't match some other > pattern in PHP; the problem is that the function doesn't do what its > name says it does. > > "if

Re: [PHP-DEV] static constructor

2015-03-12 Thread Rowan Collins
Patrick Schaaf wrote on 12/03/2015 18:40: Am 12.03.2015 18:56 schrieb "Rowan Collins" >: > > Johannes Ott wrote on 12/03/2015 17:05: > So doing a null check each time is a overhead of calculation which can be avoided with this static constructor pa

Re: [PHP-DEV] static constructor

2015-03-12 Thread Patrick Schaaf
Am 12.03.2015 20:12 schrieb "Dan Ackroyd" : > > Patrick Schaaf wrote: > > But that has proven, in the past, a fountain of joy wrt. > > placement, with variations needed for APC and opcache, and general frustration > > all around. > > Is there a bug report for the problems? OPCache shouldn't have >

Re: [PHP-DEV] static constructor

2015-03-12 Thread Dan Ackroyd
Patrick Schaaf wrote: > But that has proven, in the past, a fountain of joy wrt. > placement, with variations needed for APC and opcache, and general frustration > all around. Is there a bug report for the problems? OPCache shouldn't have side-effects on the code. cheers Dan On 12 March 2015 a

Re: [PHP-DEV] static constructor

2015-03-12 Thread Patrick Schaaf
Am 12.03.2015 18:56 schrieb "Rowan Collins" : > > Johannes Ott wrote on 12/03/2015 17:05: > So doing a null check each time is a overhead of calculation which can be avoided with this static constructor pattern. >>> >>> Presumably the engine would need to perform some implicit equiva

Re: [PHP-DEV] static constructor

2015-03-12 Thread Rowan Collins
Johannes Ott wrote on 12/03/2015 17:05: Am 12.03.2015 um 16:57 schrieb Rowan Collins: Johannes Ott wrote on 12/03/2015 14:51: That is nearly like initializing a class constant, but in my opinion a constant should not have a "complex" algorithm (For example conditions or read from filesystem). T

Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-12 Thread Lester Caine
On 12/03/15 16:55, Larry Garfield wrote: > On 3/12/15 4:11 AM, Lester Caine wrote: >> On 12/03/15 08:29, Zeev Suraski wrote: >>> There have been NO big changes to the proposal - only two tweaks which I >>> clearly detailed in the Vote email, that have been publicly discussed in >>> detail on intern

Re: [PHP-DEV] static constructor

2015-03-12 Thread Alexey Zakhlestin
> On 12 Mar 2015, at 19:28, Larry Garfield wrote: > > I thought it sounded familiar. Also check the list archive for "A modest > proposal: __constructStatic" from a month ago. It was rejected then, too. > > Really, I cannot think of any cases where I want to have a static class > self-initi

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
Am 12.03.2015 um 16:57 schrieb Rowan Collins: > Johannes Ott wrote on 12/03/2015 14:51: >> That is nearly like initializing a class constant, but in my opinion a >> constant should not have a "complex" algorithm (For example conditions >> or read from filesystem). That should be encapsulated inside

Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-12 Thread Larry Garfield
On 3/12/15 4:11 AM, Lester Caine wrote: On 12/03/15 08:29, Zeev Suraski wrote: There have been NO big changes to the proposal - only two tweaks which I clearly detailed in the Vote email, that have been publicly discussed in detail on internals@ more than a week ago. Zeev ... being realistic I

Re: [PHP-DEV] static constructor

2015-03-12 Thread Patrick Schaaf
Am 12.03.2015 17:28 schrieb "Larry Garfield" : > > I thought it sounded familiar. Also check the list archive for "A modest proposal: __constructStatic" from a month ago. It was rejected then, too. That proposal was about a completely different issue. But you are right, it was dismissed using t

Re: [PHP-DEV] static constructor

2015-03-12 Thread Larry Garfield
On 3/12/15 10:57 AM, Rowan Collins wrote: Johannes Ott wrote on 12/03/2015 14:51: That is nearly like initializing a class constant, but in my opinion a constant should not have a "complex" algorithm (For example conditions or read from filesystem). That should be encapsulated inside a proper me

Re: [PHP-DEV] static constructor

2015-03-12 Thread Rowan Collins
Johannes Ott wrote on 12/03/2015 14:51: That is nearly like initializing a class constant, but in my opinion a constant should not have a "complex" algorithm (For example conditions or read from filesystem). That should be encapsulated inside a proper method body. I agree, but as such, I think

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
Am 12.03.2015 um 12:40 schrieb Niklas Keller: > > How would it behave for the second call? If the first initialize fails due > to some exception, should that static constructor be executed again? > I think there a two different solutions and I do not know which one I prefer at the moment: 1. N

RE: [PHP-DEV] [VOTE] Make empty() a Variadic

2015-03-12 Thread Derick Rethans
On Thu, 12 Mar 2015, Thomas Punt wrote: > Hey PHP Internals, > > So there hasn't been much discussion on this RFC, and yet a lot of people have > voted -1 on it. This is a little disappointing because I'm not entirely sure > why > people are against it - and no one seems to want to debate it eit

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
> > Most of these examples are just crying out to be real objects, not > static classes. You might not want to be creating them every time you > use them, but that's what patterns like Singletons and Dependency > Injection are for. > I really disagree to this. Singletons are a typical FactoryP

Re: [PHP-DEV] php_stream_read(...) may return less than expected

2015-03-12 Thread Michael Wallner
On 12/03/15 14:28, Umberto Salsi wrote: > Hi all, > I'm not a PHP internals developer, but this might be a bug spread here and > there in the source. This coding pattern: > > if(php_stream_read(..., n) != n){ > php_error_docref(NULL TSRMLS_CC, E_SOMETHING, "Read error!"); > > seems wrong to m

[PHP-DEV] php_stream_read(...) may return less than expected

2015-03-12 Thread Umberto Salsi
Hi all, I'm not a PHP internals developer, but this might be a bug spread here and there in the source. This coding pattern: if(php_stream_read(..., n) != n){ php_error_docref(NULL TSRMLS_CC, E_SOMETHING, "Read error!"); seems wrong to me because there might be streams that returns less than

Re: [PHP-DEV] Safe execution timeout handling

2015-03-12 Thread Dan Ackroyd
On 11 March 2015 at 21:44, Dmitry Stogov wrote: > Hi, > > Improvement ideas are welcome... Hi Dmitry, The idea was raised before of having both soft and hard limits for the memory consumption and time limits, and to trigger a user defined callback when the soft limit was reached. This would be

Re: [PHP-DEV] static constructor

2015-03-12 Thread Rowan Collins
Johannes Ott wrote on 12/03/2015 08:54: Am 12.03.2015 um 05:17 schrieb Levi Morrison: On Wed, Mar 11, 2015 at 6:10 PM, Rowan Collins wrote: On 11/03/2015 23:21, Johannes Ott wrote: So now I want to do my first own proposal for a new function in PHP and I hope doing it right with starting a di

Re: [PHP-DEV] static constructor

2015-03-12 Thread Crypto Compress
Am 12.03.2015 um 12:33 schrieb Johannes Ott: Am 12.03.2015 um 12:16 schrieb Crypto Compress: Hello Johannes, class Foo { private static function __static() { throw new Exception("boom"); } } while(true) { try { $foo = new Foo; } catch (Exception ex) {} }

Re: [PHP-DEV] static constructor

2015-03-12 Thread Rowan Collins
Patrick Schaaf wrote on 12/03/2015 08:40: On Thursday 12 March 2015 00:10:15 Rowan Collins wrote: On 11/03/2015 23:21, Johannes Ott wrote: The purpose of this suggestion is to introduce a static constructor, which is called before the first call to class either static or non-static to initiali

Re: [PHP-DEV] [VOTE] Make empty() a Variadic

2015-03-12 Thread Dan Ackroyd
On 12 March 2015 at 09:58, Thomas Punt wrote: > Hey PHP Internals, > I'm not entirely sure why > people are against it - and no one seems to want to debate it either. I think these were covered in the discussion phase, but I will reiterate the reasons I voted against it for clarity. > The falsy

Re: [PHP-DEV] static constructor

2015-03-12 Thread Niklas Keller
2015-03-12 12:33 GMT+01:00 Johannes Ott : > Am 12.03.2015 um 12:16 schrieb Crypto Compress: > > Hello Johannes, > > > > class Foo { > > private static function __static() { > > throw new Exception("boom"); > > } > > } > > > > while(true) { > > try { > > $foo = new Foo;

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
Am 12.03.2015 um 12:16 schrieb Crypto Compress: > Hello Johannes, > > class Foo { > private static function __static() { > throw new Exception("boom"); > } > } > > while(true) { > try { > $foo = new Foo; > } catch (Exception ex) {} > } > > Would this code be valid

Re: [PHP-DEV] static constructor

2015-03-12 Thread Crypto Compress
Hello Johannes, class Foo { private static function __static() { throw new Exception("boom"); } } while(true) { try { $foo = new Foo; } catch (Exception ex) {} } Would this code be valid? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, vi

Re: [PHP-DEV] Consistent function names

2015-03-12 Thread Lester Caine
> Do you mean the PostgreSQL driver needs to be changed from pg_blah() to > pgBlah() ? It was that extra underscores having been added to the pg_ functions is being put forward as a reason for adding them everywhere else. That is perhaps when this discussion should have been undertaken, but someo

Re: [PHP-DEV] Consistent function names

2015-03-12 Thread Arvids Godjuks
2015-03-12 11:41 GMT+02:00 Lester Caine : > On 12/03/15 09:21, Arvids Godjuks wrote: > > Basically this. > > > > Yasuo asked me some time ago how do I see the new interface, and to be > > frank, I do not see a new procedural api interface at all. We have one > > now, and adding a new subset of it

RE: [PHP-DEV] [VOTE] Make empty() a Variadic

2015-03-12 Thread Thomas Punt
Hey PHP Internals, So there hasn't been much discussion on this RFC, and yet a lot of people have voted -1 on it. This is a little disappointing because I'm not entirely sure why people are against it - and no one seems to want to debate it either. >From pre-RFC discussions, two main concerns wer

Re: [PHP-DEV] Consistent function names

2015-03-12 Thread Lester Caine
On 12/03/15 09:21, Arvids Godjuks wrote: > Basically this. > > Yasuo asked me some time ago how do I see the new interface, and to be > frank, I do not see a new procedural api interface at all. We have one > now, and adding a new subset of it looks pointless. It has it's problems > and legacy, yo

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
> > What about inheritance? > I think dynamic class-constructor would make much more sense. > A function which can analyse real class and do initialisation. > > class A > { > protected static function __class_construct() > { > echo get_called_class().” class is defined\n"; > }

Re: [PHP-DEV] [RFC] Basic Scalar Types

2015-03-12 Thread Arvids Godjuks
2015-03-12 11:23 GMT+02:00 Zeev Suraski : > > -Original Message- > > From: Bob Weinand [mailto:bobw...@hotmail.com] > > Sent: Thursday, March 12, 2015 12:46 AM > > To: Pierre Joye > > Cc: PHP internals > > Subject: Re: [PHP-DEV] [RFC] Basic Scalar Types > > > > Correct. It's just for the c

RE: [PHP-DEV] [RFC] Basic Scalar Types

2015-03-12 Thread Zeev Suraski
> So really, the options we have are: > > 1. Put this one for a vote before the end of tomorrow. Here too, on a > personal level, if I see that this proposal isn't gaining enough votes, I'd > support the dual mode one. > 2. Don't put it up for a vote, and then we may or may not have something >

Re: [PHP-DEV] Consistent function names

2015-03-12 Thread Arvids Godjuks
2015-03-12 4:08 GMT+02:00 Lester Caine : > On 11/03/15 22:44, Yasuo Ohgaki wrote: > > Having namespace for internals would bring much flexibility for API > changes, both > > OO and procedural API. I may try my best to have consensus. > > > > I think you also like to have OO style API for basic > >

RE: [PHP-DEV] [RFC] Basic Scalar Types

2015-03-12 Thread Zeev Suraski
> -Original Message- > From: Bob Weinand [mailto:bobw...@hotmail.com] > Sent: Thursday, March 12, 2015 12:46 AM > To: Pierre Joye > Cc: PHP internals > Subject: Re: [PHP-DEV] [RFC] Basic Scalar Types > > Correct. It's just for the case where the other two fail. > We still can add strict mod

RE: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-12 Thread Zeev Suraski
> In addition, I'm voting no for the following reasons (in addition to > Dan's): > > 1. It downplays the BC breaks. It says: > > > Given the change to the acceptable values into a wide range of > internal > functions, this RFC is likely to result in a substantial number of newly > introduced E_

Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-12 Thread Lester Caine
On 12/03/15 08:29, Zeev Suraski wrote: > There have been NO big changes to the proposal - only two tweaks which I > clearly detailed in the Vote email, that have been publicly discussed in > detail on internals@ more than a week ago. Zeev ... being realistic I think that the chances of getting ano

Re: [PHP-DEV] [RFC] Basic Scalar Types

2015-03-12 Thread Markus Fischer
On 11.03.15 22:28, Bob Weinand wrote: > after all, some people are not happy with the current proposals about scalar > types. So, they both still possibly may fail. > > Thus, I'd like to come up with a fallback proposal in case both proposals > fail: > > https://wiki.php.net/rfc/basic_scalar_ty

Re: [PHP-DEV] static constructor

2015-03-12 Thread Johannes Ott
Am 12.03.2015 um 05:17 schrieb Levi Morrison: > On Wed, Mar 11, 2015 at 6:10 PM, Rowan Collins > wrote: >> On 11/03/2015 23:21, Johannes Ott wrote: >>> >>> So now I want to do my first own proposal for a new function in PHP and >>> I hope doing it right with starting a discussion here first. >>>

Re: [PHP-DEV] static constructor

2015-03-12 Thread Patrick Schaaf
On Thursday 12 March 2015 00:10:15 Rowan Collins wrote: > On 11/03/2015 23:21, Johannes Ott wrote: > > > The purpose of this suggestion is to introduce a static constructor, > > which is called before the first call to class either static or > > non-static to initialize some static properties which

Re: [PHP-DEV] Re: Introduce DerOetzi

2015-03-12 Thread Niklas Keller
You have to input "internals@lists.php.net", that changed some time ago. I've just updated https://wiki.php.net/rfc/howto See https://github.com/php/web-wiki/commit/583d2c1b39a8b88960ab94e56ba4a4608ddb2353 Regards, Niklas 2015-03-11 14:43 GMT+01:00 Johannes Ott : > Am 11.03.2015 um 14:25 schrieb

Re: [PHP-DEV] Request Feedback for Instance Variable Sugar RFC

2015-03-12 Thread Johannes Ott
Am 11.03.2015 um 14:03 schrieb Rowan Collins: > Johannes Ott wrote on 10/03/2015 20:46: >> okay indeed the dynamic properties are a problem I didn't think about on >> my suggestion. Without the wish to hijack this thread for another >> typesafety discussion, I must say again that PHP needs a less d

RE: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-12 Thread Zeev Suraski
> -Original Message- > From: Ole Markus With [mailto:olemar...@olemarkus.org] > Sent: Thursday, March 12, 2015 10:10 AM > To: Pierre Joye; Zeev Suraski > Cc: PHP internals > Subject: Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints > > > > On 03/11/2015 09:05 PM, Pierre Joye wrote: > >

Re: [PHP-DEV] static constructor

2015-03-12 Thread Alexey Zakhlestin
> On 12 Mar 2015, at 02:21, Johannes Ott wrote: > > So now I want to do my first own proposal for a new function in PHP and > I hope doing it right with starting a discussion here first. > > The purpose of this suggestion is to introduce a static constructor, > which is called before the first

Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count

2015-03-12 Thread Patrick ALLAERT
Le mar. 10 mars 2015 à 21:04, Marcio Almada a écrit : > > > 2015-03-10 12:31 GMT-03:00 Patrick ALLAERT : > >> Hello, >> >> Le lun. 2 mars 2015 à 00:03, Marcio Almada a >> écrit : >> >> >> I'm globally +0.5, however I have some concerns: >> >> What about constructors? >> >> Children classes may

Re: [PHP-DEV] static constructor

2015-03-12 Thread Patrick Schaaf
On Thursday 12 March 2015 00:21:34 Johannes Ott wrote: > > The purpose of this suggestion is to introduce a static constructor, > which is called before the first call to class either static or > non-static to initialize some static properties which are needed by the > class. We are doing this in

Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-12 Thread Ole Markus With
On 03/11/2015 09:05 PM, Pierre Joye wrote: > On Mar 12, 2015 2:10 AM, "Zeev Suraski" wrote: >> >> The vote on the Coercive Scalar Type Hints is now open for voting. >> >> >> >> The latest version of the RFC includes changes discussed on internals@ > last >> week: >> >> 1. Accept string->bool an

Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count

2015-03-12 Thread Marcio Almada
2015-03-10 12:31 GMT-03:00 Patrick ALLAERT : > Hello, > > Le lun. 2 mars 2015 à 00:03, Marcio Almada a > écrit : > > > I'm globally +0.5, however I have some concerns: > > What about constructors? > > Children classes may have a bigger number of arguments for their ctors > than their parents. Ev

Re: [PHP-DEV] Request Feedback for Instance Variable Sugar RFC

2015-03-12 Thread Johannes Ott
Am 11.03.2015 um 17:21 schrieb Rowan Collins: > > My reasoning is that code that is ambiguous is hard to read. If "$foo" > can mean either "a local variable called $foo" or "a property of the > current object called $foo", then you have to know which it is in order > to understand what code is do

Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-12 Thread Dan Ackroyd
Voting no due to: i) Having conversion rules be difference in userland to internal functions. You list 'Single Mode' as a benefit of this RFC, but it's only single mode if you gloss over this difference. This is a massive cognitive load, and will be one of those issues that catches users out agai

Re: [PHP-DEV] Introduce DerOetzi

2015-03-12 Thread Anthony Ferrara
Welcome!!! I'd love to hear more about your thesis if you can share! Anthony On Tue, Mar 10, 2015 at 6:56 AM, Johannes Ott wrote: > Hi, > > sorry I did the wrong order, starting to discuss already without > introducing me first: > > My name is Johannes Ott. I am 31 years old. I'm developing wit

Re: [PHP-DEV] Voting choice for language changes (Was: "Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count")

2015-03-12 Thread Derick Rethans
On Tue, 10 Mar 2015, Patrick ALLAERT wrote: > 2015-03-10 16:02 GMT+01:00 Anthony Ferrara : > > > > Can we please come down to a single RFC, with a single vote yes/no? > > It's easier to understand, easier to manage and has less possibility > > of gaming. > > That is much more stricter than my tho

Re: [PHP-DEV] Voting choice for language changes (Was: "Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count")

2015-03-12 Thread Dan Ackroyd
On 10 March 2015 at 15:02, Anthony Ferrara wrote: > > Can we please come down to a single RFC, with a single vote yes/no? > It's easier to understand, easier to manage and has less possibility > of gaming. While I generally agree, in the case where there is a small detail that needs to be addres