[PHP-DEV] Evaluation of constructor arguments if there's no constructor

2014-08-13 Thread Tjerk Meesters
Hi internals, I was sifting through the bucket o’ bugs and found these two related issues: https://bugs.php.net/bug.php?id=67829 https://bugs.php.net/bug.php?id=54162 (closed) They concern the behaviour of the engine when a class defines no constructor or if the class to be instantiated doesn’t

Re: [PHP-DEV] [VOTE] Mutliple defaults in switch statements

2014-08-13 Thread Florian Anderiasch
On 14.08.2014 00:12, James Ward wrote: > I'm not entirely sure that a backwards compatibility break in a minor > release would be considered non-controversial. > > [...] > > I see this as a bad design choice in the language which should be > rectified... just in a major version. > As it doesn't

Re: [PHP-DEV] Can't use php_error_docref in zend_API.c?

2014-08-13 Thread Andrea Faulds
On 14 Aug 2014, at 03:13, Aaron Lewis wrote: > I'm trying to print error messages in zend, so I add a function in > zend_API.{h,c} > > Then I got and error: > /Zend/zend_API.c:3226: undefined reference to `php_error_docref > > So, what's the appropriate function to use? zend_error_docref does

[PHP-DEV] Can't use php_error_docref in zend_API.c?

2014-08-13 Thread Aaron Lewis
Hi, I'm trying to print error messages in zend, so I add a function in zend_API.{h,c} Then I got and error: /Zend/zend_API.c:3226: undefined reference to `php_error_docref So, what's the appropriate function to use? -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Pr

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Stas Malyshev
Hi! > And this, which is completely undetectable at parse time: > > $bar = 30; > // ... arbitrary amount of code > switch ( $foo ) { > case $bar: > case 30: > } That's not all. You can also do: switch (true) { case foo($bar): ... case baz($quz, $qux): ... } and this is a complet

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Kris Craig
On Wed, Aug 13, 2014 at 3:21 PM, Drew Paroski wrote: > On 6 August 2014 12:32, Ferenc Kovacs wrote: > > > > I'm not sure what would be the best solution, but if we don't version the > > spec, then when we introduce BC breaks or simply new features in a new > > version which is in turn get's adde

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Drew Paroski
On 6 August 2014 12:32, Ferenc Kovacs wrote: > > I'm not sure what would be the best solution, but if we don't version the > spec, then when we introduce BC breaks or simply new features in a new > version which is in turn get's added to the spec, that would make the older > php version's(from any

Re: [PHP-DEV] [VOTE] Mutliple defaults in switch statements

2014-08-13 Thread James Ward
I'm not entirely sure that a backwards compatibility break in a minor release would be considered non-controversial. While this change is pretty trivial, both technically and syntactically, I'm unsure why there even is an RFC process in place if it's going to be ignored because it's "too much trou

Re: [PHP-DEV] [VOTE] Mutliple defaults in switch statements

2014-08-13 Thread David Soria Parra
On 2014-08-12, Sara Golemon wrote: > On Tue, Aug 12, 2014 at 10:08 AM, Andrea Faulds wrote: >> On 12 Aug 2014, at 17:53, Sara Golemon wrote: >>> Voting is open: https://wiki.php.net/rfc/switch.default.multiple#vote >> >> I’m all for this, but the *minimum* discussion period is *two* weeks. >> >

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-13 Thread Andrey Andreev
Hi, I'd personally find it horrible if $foo[$i] = $bar[$i++]; is executed right-to-left, but given that your examples are a bit weird, I'm not sure if mine is affected. Is it? Cheers, Andrey. On Aug 13, 2014 10:05 PM, "Nikita Popov" wrote: > > On Wed, Aug 13, 2014 at 7:18 PM, guilhermebla...@gm

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-13 Thread Nikita Popov
On Wed, Aug 13, 2014 at 7:18 PM, guilhermebla...@gmail.com < guilhermebla...@gmail.com> wrote: > When is this planned to go through voting process? > Before voting I'd like to have some opinions on the behavioral differences the proposal introduces. In particular I'd like to know whether we are o

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-13 Thread guilhermebla...@gmail.com
When is this planned to go through voting process? On Sat, Aug 2, 2014 at 5:27 PM, Andrea Faulds wrote: > Hi! > > On 2 Aug 2014, at 21:44, Nikita Popov wrote: > > > Why do you think this isn't a good idea? I think it would be a nice way > to prototype language features before pulling them into

Re: [PHP-DEV] [VOTE] Move the phpng branch to master

2014-08-13 Thread Pascal MARTIN
Le 06/08/2014 14:36, Zeev Suraski a écrit : I opened the voting on the phpng RFC: https://wiki.php.net/rfc/phpng#vote Voting ends on Thursday, August 14th. After speaking with other members of AFUP (French user-group) about this RFC, here's a short summary of our thoughts: The idea of (

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Matthew Fonda
On Wed, Aug 13, 2014 at 3:24 AM, Peter Cowburn wrote: > > My thoughts on the topic? I think we're in danger of letting "process" get > in our way here. It's a bug fix which IMHO should even be thrown into 5.6 > (this is a bug fix!). Going through the RFC process, being forced to wait > for 5.7 or

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Pierre Joye
On Wed, Aug 13, 2014 at 5:42 PM, Sara Golemon wrote: > I woke up to this thread, and at first I thought: > > Oh, some actual discussion, maybe we should stop the vote after all > and give it some time... > One or two minor points here... > And there's the bike shed. > > For my own sanity, I'm goin

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Sara Golemon
I woke up to this thread, and at first I thought: Oh, some actual discussion, maybe we should stop the vote after all and give it some time... One or two minor points here... And there's the bike shed. For my own sanity, I'm going to leave this to the people who care about the import things like

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 5:20 PM, Kalle Sommer Nielsen wrote: > Hi > > 2014-08-13 13:02 GMT+02:00 Ferenc Kovacs : > > agree, and I thought about mentioning that, but I left that out, because > > I'm not proposing to remove that ability (and I see more use-cases for > that > > as mentioned in my p

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Kalle Sommer Nielsen
Hi 2014-08-13 13:02 GMT+02:00 Ferenc Kovacs : > agree, and I thought about mentioning that, but I left that out, because > I'm not proposing to remove that ability (and I see more use-cases for that > as mentioned in my previous email) but stating that this patch would make > an arbitrary distinc

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread James
Even if it is fall through that is causing the behavior it still is a syntax that no longer will be considered valid in a minor release - and seemingly in a point release as well if everyone had their way here. [: Not that I consider code likehttp://3v4l.org/ mtG4K

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 3:55 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > >> I think you misunderstood that part, I was thinking about a state machine >> like this: >> >> 1. function doStuff(){ >> 2. switch($state){ >> 3. case OPENDOOR: >> 4. if(!opendoor()){ >> 5. break

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Rowan Collins
Ferenc Kovacs wrote (on 13/08/2014): I think you misunderstood that part, I was thinking about a state machine like this: 1. function doStuff(){ 2. switch($state){ 3. case OPENDOOR: 4. if(!opendoor()){ 5. break; 6. } 7. $state = SITDOWN; 8. case SITDOWN: 9. if(!sitdown()){ 10

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 3:42 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > >> >> It is not selecting the first default, it just never needs to look >> for a default, because it has already found a matching case label. >> >> >> yes, and it continues the execution from t

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Rowan Collins
Ferenc Kovacs wrote (on 13/08/2014): It is not selecting the first default, it just never needs to look for a default, because it has already found a matching case label. yes, and it continues the execution from the first matching case and correctly evaluates the following defaults, a

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 2:58 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > >> Btw. I've added a comment to https://bugs.php.net/bug.php?id=67757 as >> I've found some really weird behavior for multiple defaults and I think >> that it would be better to try to figure out and fi

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 2:52 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > >> not sure what do you mean here, multiple default cases can be reached the >> >> same way as any other duplicated case branch(as shown in my snippet in the >> mail you replied to). >> > > If you're ta

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Rowan Collins
Ferenc Kovacs wrote (on 13/08/2014): Btw. I've added a comment to https://bugs.php.net/bug.php?id=67757 as I've found some really weird behavior for multiple defaults and I think that it would be better to try to figure out and fix why do we pick the last default in the problematic snippet inst

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Rowan Collins
Ferenc Kovacs wrote (on 13/08/2014): not sure what do you mean here, multiple default cases can be reached the same way as any other duplicated case branch(as shown in my snippet in the mail you replied to). If you're talking about http://3v4l.org/eZdPU then those duplicates are definitely bei

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 2:42 PM, Ferenc Kovacs wrote: > > > > On Wed, Aug 13, 2014 at 2:27 PM, Rowan Collins > wrote: > >> Ferenc Kovacs wrote (on 13/08/2014): >> >>> agree, and I thought about mentioning that, but I left that out, because >>> I'm not proposing to remove that ability (and I see

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 2:27 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > >> agree, and I thought about mentioning that, but I left that out, because >> I'm not proposing to remove that ability (and I see more use-cases for that >> as mentioned in my previous email) but stati

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Rowan Collins
Ferenc Kovacs wrote (on 13/08/2014): agree, and I thought about mentioning that, but I left that out, because I'm not proposing to remove that ability (and I see more use-cases for that as mentioned in my previous email) but stating that this patch would make an arbitrary distinction between th

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Alain Williams
On Wed, Aug 13, 2014 at 12:57:40PM +0200, Ferenc Kovacs wrote: > On Wed, Aug 13, 2014 at 11:42 AM, Andrea Faulds wrote: > > > Hi! > > > > On 13 Aug 2014, at 08:47, Ferenc Kovacs wrote: > > > > > and I also think that this isn't an important enough issue to warrant a > > BC > > > break (albeit th

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 12:22 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > > sorry to jump in this late, but I'm not sure that it is a good idea to >> only >> reject the multiple default blocks but keep the ability to have the same >> case multiple times: >> http://3v4l.org/

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 11:42 AM, Andrea Faulds wrote: > Hi! > > On 13 Aug 2014, at 08:47, Ferenc Kovacs wrote: > > > and I also think that this isn't an important enough issue to warrant a > BC > > break (albeit this is the better kind of BC: probably doesn't effect too > > many people, and the

RE: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Christian Stoller
From: Andrea Faulds [mailto:a...@ajf.me] Sent: Wednesday, August 13, 2014 11:43 AM > > Hi! > > On 13 Aug 2014, at 08:47, Ferenc Kovacs wrote: > >> and I also think that this isn't an important enough issue to warrant a BC >> break (albeit this is the better kind of BC: probably doesn't effect to

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Andrea Faulds
On 13 Aug 2014, at 11:24, Peter Cowburn wrote: > > On 13 August 2014 10:56, Andrea Faulds wrote: > > > However, I tend to think that we should simply target php7 for any of > > these fixes. No need of endless arguing and keeps everyone happy. > > I’d rather we fix these in 5.7, which I’m a p

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Peter Cowburn
On 13 August 2014 10:56, Andrea Faulds wrote: > > On 13 Aug 2014, at 10:52, Pierre Joye wrote: > > > On Wed, Aug 13, 2014 at 11:42 AM, Andrea Faulds wrote: > > > >>> I could see > >>> where people would use it - there are reasons to, even if they are > poor in > >>> choice to do so. > >> > >> H

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Rowan Collins
Ferenc Kovacs wrote (on 13/08/2014): sorry to jump in this late, but I'm not sure that it is a good idea to only reject the multiple default blocks but keep the ability to have the same case multiple times: http://3v4l.org/eZdPU Multiple cases with the same value are a lot harder to prevent (if

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Andrea Faulds
On 13 Aug 2014, at 10:52, Pierre Joye wrote: > On Wed, Aug 13, 2014 at 11:42 AM, Andrea Faulds wrote: > >>> I could see >>> where people would use it - there are reasons to, even if they are poor in >>> choice to do so. >> >> How, exactly, could there ever be a use for having multiple default

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Pierre Joye
On Wed, Aug 13, 2014 at 11:42 AM, Andrea Faulds wrote: >> I could see >> where people would use it - there are reasons to, even if they are poor in >> choice to do so. > > How, exactly, could there ever be a use for having multiple default: sections > and ignoring all but one? This “feature” is

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Andrea Faulds
Hi! On 13 Aug 2014, at 08:47, Ferenc Kovacs wrote: > and I also think that this isn't an important enough issue to warrant a BC > break (albeit this is the better kind of BC: probably doesn't effect too > many people, and they will be clearly notified about the error at compile > time) so I vote

Re: [PHP-DEV] Reflection to remove final

2014-08-13 Thread Julien Pauli
On Tue, Aug 12, 2014 at 8:52 PM, Stas Malyshev wrote: > Hi! > >> I've just been looking back at the history of this previous conversation... >> >> http://marc.info/?l=php-internals&m=132673741606531&w=2 >> >> as a mockist tester I'd really REALLY like to see this be possible but I >> can see the p

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Lester Caine
On 13/08/14 09:48, Ferenc Kovacs wrote: > I wanted to say that > and I also think that this isn't an important enough issue to warrant a BC > break in a minor version Reading between the lines this does seem to be more a problem for HHVM which has not copied the current operation properly. The que

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 13, 2014 at 10:38 AM, Pierre Joye wrote: > On Wed, Aug 13, 2014 at 9:47 AM, Ferenc Kovacs wrote: > > On Wed, Aug 6, 2014 at 6:38 AM, Sara Golemon wrote: > > > >> https://wiki.php.net/rfc/switch.default.multiple > >> > >> 'Cause this code is silly (even if it had case blocks), but we

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Pierre Joye
On Wed, Aug 13, 2014 at 9:47 AM, Ferenc Kovacs wrote: > On Wed, Aug 6, 2014 at 6:38 AM, Sara Golemon wrote: > >> https://wiki.php.net/rfc/switch.default.multiple >> >> 'Cause this code is silly (even if it had case blocks), but we allow it: >> >> switch ($expr) { >> default: >> notExecuted(

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread James
Just saw the RFC today so I hadn't been able to comment on it until now.. If we are getting rid of it wouldn't it be better to emit an E_DEPRECATED per https://github.com/imnotjames/php-src/compare/switch.default.multiple-deprecated and then remove it in the next major release? This has been know

Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement

2014-08-13 Thread Ferenc Kovacs
On Wed, Aug 6, 2014 at 6:38 AM, Sara Golemon wrote: > https://wiki.php.net/rfc/switch.default.multiple > > 'Cause this code is silly (even if it had case blocks), but we allow it: > > switch ($expr) { > default: > notExecuted(); > break; > default: > executed(); > } > > -- > PHP I

[PHP-DEV] Re: glob() bug 47358

2014-08-13 Thread Pierre Joye
hi Stas, Jakub, On Wed, Aug 13, 2014 at 12:23 AM, Stas Malyshev wrote: > Hi! > > Recently bug 47358 came to my attention, and there's something strange > with it. It is fixed only for 5.6, not listed in NEWS for even that > version, but the log contains these: > > commit f566b4d32183032663ecb3589