Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator

2019-04-24 Thread Sara Golemon
On Wed, Apr 24, 2019 at 6:48 PM Christoph M. Becker 
wrote:

> On 24.04.2019 at 19:25, Sara Golemon wrote:
>
> > On Tue, Apr 23, 2019 at 3:56 AM Nikita Popov 
> wrote:
> >
> >> 20 years of code in the wild has not "accepted that fact and moved on".
> If
> >> a left-associative ternary is used, it is almost certainly a bug. If
> people
> >> use this structure by accident (because it is familiar from other
> >> programming languages), I'd like them to get an error instead of having
> to
> >> figure out why their obviously correct code is not working or, in the
> worse
> >> case, just leave behind buggy code.
> >
> > I'm on dismal wifi at the moment, else I'd do some searches, but do you
> > have any examples of code in the wild subject to this bug?
> > I agree it's a lousy state, but it's not emergent.
>
> See .
>
>  Okay, so the most compelling part for me in this analysis is the fact
that Symfony and ZF have issues.  I can shrug off a lot of questionable PHP
coders, but i have to acknowledge major frameworks stumbling on this gotcha.

Convinced.
+1

-Sara


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Michael Kliewe

Hi there,

Am 24.04.2019 um 21:07 schrieb Peter Kokot:

Hello,

On Wed, 24 Apr 2019 at 19:44, Chase Peeler  wrote:

On Wed, Apr 24, 2019 at 1:27 PM Marco Pivetta  wrote:


Run a fixer: they are out there, and they are extremely stable too.

Also a good chance to finally take a look at code that has been rotting in
a hard drive for too much time.


All of that takes time though. I have 6,787 short opening tags found. Even
if I use a fixer to generate a diff, or, to fix them and then examine the
diff in a pull request... that's going to take a LOT of time. It's going to
start getting messy if I find false positives and need to exclude changes.
It still doesn't address the impact of changes that aren't found. Are you
100% positive that the fixers out there will catch EVERY single instance?
php-cs-fixer doesn't update 
I've done few commits with about 8k files changed with very repeating
changes like this and without breaking anything. It will take you
about 30minutes... Let's say, one hour for also taking a break from
all the scrolling the git diff and to return the merge the next day
after another check or something like this.

The change (speaking for 8k files using short opening tags converted
to 


Some thoughts and numbers from my side.

Nobody should not use a simple grep or sed like this:

grep -rin "It does not search in .phtml templates for example. And it has lots of 
false-positives.


This is the output in one of my projects:

# grep -rin "./scripts/OpenInviter/autoupdate.php:97: 
$start=0;$end=strpos($res,"
./scripts/_soap/_soap.php:1:./scripts/XXXupload.php:67:    Text: value="">
./scripts/XXXupload.php:68:    Text2: name="text2" value="">

Binary file ./library/phpillow/tests/phpillow/data/image_gif.gif matches
Binary file 
./library/phpillow/tests/phpillow/data/.svn/text-base/image_gif.gif.svn-base 
matches
./library/ezcomponents/Mail/src/tools.php:225:    $pattern = 
'/?$/';

./library//SoapApi.php:1:Binary file 
./library/dompdf/lib/php-font-lib/sample-fonts/IntelClear-Light.ttf matches



Result:
2 false positives
3 results because "in the file path. Better check would be:

  grep -rin "BUT: That simple grep did only find a small fraction of the problems, 
for example .phtml templates were not scanned. Continue reading...



php-cs-fixer with default settings produced a diff file with 3403 lines, 
51 line changes:
php php-cs-fixer-v2.phar fix --rules=full_opening_tag --diff --dry-run . 
> result.txt
Reviewing these 51 changes took 3 minutes. No false positives here, all 
of them were at the beginning of files.


BUT: it didn't search in .phtml files. php-cs-fixer by default only 
processes .php and .phpt files (depending on the version you are using, 
older versions also process .twig files as far as I can see). If you use 
it, you may have to add other file extensions like .phtml, .tpl or 
similar, depending on your project.


Running php-cs-fixer on .phtml files in that project results in a diff 
file with 9527 lines, 1573 line changes just in the .phtml files of that 
project. Whao...



I'm not sure if I'm alone, but I have lots of template code like this:


Xdata as $index => $data) { ?>
        Something




Blindly replacing "
Xdata as $index => $data) { ?>
        Something




The nice visual indenting of the "foreach" with 4 spaces is broken now, 
and cannot be fixed, because "Yes, minor problem of cause, but it looked nice before, and now looks 
broken and "wrongly indented".



Some random thoughts:
- What happens to .phar files? Do we have to scan the contents?
- What happens to "executable php files"? They don't have a file 
extension, but a shebang "#!/usr/bin/env php", and potentially 
short-open-tags in it.
- What happens if I miss to add a file extension to php-cs-fixer while 
scanning and fixing code I'm not 100% familiar with? Code leak :-(
- What happens if I upgrade a server to PHP8, but do not check all 
folders and projects on it?
- What happens if a Shared Hosting Provider increases the PHP version to 
8 automatically for all its customers in the future? Does this happen in 
the real world? Pages will not generate a 500 error, they will leak 
code, with passwords in it...
  Same with system administrators upgrading PHP to 8 without asking 
code-owners/developers. Or migrating all projects blindly to a new 
server with PHP8 installed. I guess that might happen. I guess, nobody 
expects code leaks then...


Looks like a lot of work and problems for everybody... I didn't expect 
the RFC to pass, thought that there are too many problems and lots of 
work for no benefit :-( And I don't follow internals mailing list on a 
daily basis, just check it "every few weeks for something important"...
In the past I was fine with BC breaks, for security, performance, or 
similar. Even bigger ones (unable to detect like "Uniform Variablen 
Syntax" for example). But this one looks heavy and dangerous for no 
benefit...


At least the code leaks must not 

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Lester Caine

On 25/04/2019 00:30, Christoph M. Becker wrote:

At the same time fixes for the PHP7.2 warnings would be helpful! My
templates keep throwing 'count' warnings which currently have been fixed
by simply removing the 'count' and leaving the value blank. That is
until someone who knows how to fix it provides a fix. It's BUILDING
cached templates which can't simply be sanitised by scanning the code base!



I don't think this belongs to the internals mailing list, so see
.


If *I* was using count then that sort of fix would work. The problem is 
in the way SMARTY handles adding 'count' of a smarty variable in a 
template ... and certainly I have well although that may just require going through and wiping every cache 
and letting it rebuild. Enabling short tags is always on my check list 
since it became a requirement and I see no reason to change that.


--
Lester Caine - G8HFL
-
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 7:55 PM Lester Caine  wrote:

> On 24/04/2019 22:55, Reindl Harald wrote:
> > under which fucking stone did you live all the years that there is
> > something like 
> Code that has been working perfectly for 20+ years and does not need me
> to waste ANY time worrying about because THAT code will carry on running
> PHP5.2, but templating does not need a 60% increase in characters to
> make it work any differently!
>
> And
> > go and learn fukcing write proper code, if you still suffer from 'count'
> > warnings all your code is a mess - period
>
> has no place here either! The 'code' I am writing is to use 'count'
> function IN a smarty template and PHP7.2 complains about how SMARTY
> expands that in the template ...
>
> I also got rude emails sent to me directly by the same person. I responded
asking them to not email me again, and they just responded with another
rude email. I was just going to ignore it, but if he's doing it to other
people, I don't mind speaking up.


> --
> Lester Caine - G8HFL
> -
> Contact - https://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - https://lsces.co.uk
> EnquirySolve - https://enquirysolve.com/
> Model Engineers Digital Workshop - https://medw.co.uk
> Rainbow Digital Media - https://rainbowdigitalmedia.co.uk
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Chase Peeler
chasepee...@gmail.com


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Lester Caine

On 24/04/2019 22:55, Reindl Harald wrote:

under which fucking stone did you live all the years that there is
something like 

Code that has been working perfectly for 20+ years and does not need me 
to waste ANY time worrying about because THAT code will carry on running 
PHP5.2, but templating does not need a 60% increase in characters to 
make it work any differently!


And

go and learn fukcing write proper code, if you still suffer from 'count'
warnings all your code is a mess - period


has no place here either! The 'code' I am writing is to use 'count' 
function IN a smarty template and PHP7.2 complains about how SMARTY 
expands that in the template ...


--
Lester Caine - G8HFL
-
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator

2019-04-24 Thread Christoph M. Becker
On 24.04.2019 at 19:25, Sara Golemon wrote:

> On Tue, Apr 23, 2019 at 3:56 AM Nikita Popov  wrote:
>
>> 20 years of code in the wild has not "accepted that fact and moved on". If
>> a left-associative ternary is used, it is almost certainly a bug. If people
>> use this structure by accident (because it is familiar from other
>> programming languages), I'd like them to get an error instead of having to
>> figure out why their obviously correct code is not working or, in the worse
>> case, just leave behind buggy code.
>
> I'm on dismal wifi at the moment, else I'd do some searches, but do you
> have any examples of code in the wild subject to this bug?
> I agree it's a lousy state, but it's not emergent.

See .

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Christoph M. Becker
On 24.04.2019 at 22:47, Björn Larsson wrote:

> I recall the discussion about extending the support for 7.4 like we had
> for 5.6, see:
> - https://externals.io/message/104581#104807
>
> I read the discussion as it was rejected, but features like this would
> benefit from it,
> since not only "inhouse" code will need to adapt but also libraries.
>
> So with this feature we put more weight in the migration bucket, but not
> so much
> benefit. Are we then willing to extend the support for PHP 7.4 given
> features like
> this? Other BC breaking features will of course also benefit ;-)

We had an RFC regarding the PHP 5 support timeline[1], so why not have
an RFC regarding the PHP 7 support timeline?  Any volunteers?

[1] 

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Christoph M. Becker
On 24.04.2019 at 23:46, Lester Caine wrote:

> At the same time fixes for the PHP7.2 warnings would be helpful! My
> templates keep throwing 'count' warnings which currently have been fixed
> by simply removing the 'count' and leaving the value blank. That is
> until someone who knows how to fix it provides a fix. It's BUILDING
> cached templates which can't simply be sanitised by scanning the code base!

I don't think this belongs to the internals mailing list, so see
.

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator

2019-04-24 Thread Sara Golemon
On Wed, Apr 24, 2019 at 1:56 PM M. W. Moe  wrote:

> until this RCF does not happen; I would say nothing interesting will ever
> happen.
>
> Please, Reality TV is less hyperbolic than that.
JIT isn't interesting?
Typed Properties isn't interesting?
FFI isn't interesting?
 Preload isn't interesting?

Pack it up, folks!  Nothing we're doing here is interesting or ever will
be, because the associativity of the ternary operator is wrong.

-Sara


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Björn Larsson

Den 2019-04-24 kl. 23:35, skrev Andrey Andreev:

Hello,

I personally am not happy with the outcome of the vote. I think
there's no practical benefit to be gained from the proposal and I
don't even understand what has urged the author to make it; I voted No
on both questions.

However, what's done is done and these post-vote protests are getting
ridiculous. Where were you all during discussion and even during the
voting period? I only remember a single person's rant here and barely
any comments on social media about it ... The people who voted Yes may
have weak arguments ("there's tools out there" isn't a good argument
in my book), they may've underestimated the impact of the change or
they may not even care about it. But they cared enough to drop by and
make their views count, while almost nobody cared enough to come here
and say this isn't right. We don't get to force-reverse a decision
that we didn't care enough for when it mattered.

Cheers,
Andrey.
You are absolutely right! The only excuse for myself during the 
discussion etc
was that I thought it never would pass, so I "slept"... One thing to 
consider
though is if the BC break together with other features is big enough to 
justify

extended support for 7.4?

r//Björn L

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Stanislav Malyshev
Hi!

>> A friendly reminder that some people are hosting customer code which they
>> do not want to touch but will get support requests once the code breaks.
>>
>> - Chris
>>
> 
> That's normal? Everyone has projects to maintain, and breaking changes are
> common: they're gonna call you for one anyway: if you don't like that, then
> you are in the wrong line of business.

I think answering to a valid concern that certain change would increase
breakage and maintenance load with "well, that's what you're paid for,
right?" is not what we expect from the discussion on this list. It's
dismissing rather than discussing. Let's have less of that on the list.

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Stanislav Malyshev
Hi!

> If this RFC has caused such a resonance _after_ the vote, maybe, it
> can be reopened for a few days so that those who have not voted can
> do it?

These concerns were expressed before the vote too. They were thoroughly
ignored. That didn't make them disappear.

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Björn Larsson

Den 2019-04-24 kl. 23:38, skrev Peter Kokot:

Hello,

On Wed, 24 Apr 2019 at 23:12, Björn Larsson  wrote:

Hi,

I did a quick check on two open source libraries that I'm using,
namely Smarty templating library and Revive ad server. A quick
glance at hand shows that they both uses the 
I'm not sure if we're looking at the same libraries and versions here
but both of these use normal opening tags in the code for quite a
while:
https://github.com/revive-adserver/revive-adserver
https://github.com/smarty-php/smarty

Keywords open source, PHP, and short opening tags don't go together
anymore neither people coding in PHP are using these anymore for a
very long time. If they postpone upgrades and neglect good coding
practices, nothing can help them improve or fix their apps.


Well, checking a bit closer when running the script:
grep -rin "None

seems to be critical though. 5 in the Revive case comes from including an
old Smarty 2.6.18 version from 2005.

r//Björn L

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Lester Caine

On 24/04/2019 22:12, Björn Larsson wrote:

I did a quick check on two open source libraries that I'm using,
namely Smarty templating library and Revive ad server. A quick
glance at hand shows that they both uses the 

At the same time fixes for the PHP7.2 warnings would be helpful! My 
templates keep throwing 'count' warnings which currently have been fixed 
by simply removing the 'count' and leaving the value blank. That is 
until someone who knows how to fix it provides a fix. It's BUILDING 
cached templates which can't simply be sanitised by scanning the code base!


--
Lester Caine - G8HFL
-
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Peter Kokot
Hello,

On Wed, 24 Apr 2019 at 23:12, Björn Larsson  wrote:
> Hi,
>
> I did a quick check on two open source libraries that I'm using,
> namely Smarty templating library and Revive ad server. A quick
> glance at hand shows that they both uses the  latest release. Smarty 3.1.33 was released 17/9 2018 and
> Revive 4.2.0 was released 23/4 2019.
>
> It would be interesting to see if there is any benefit in fixing this
> feature for these two well-established libraries? I think that both
> these libraries will adapt, but how long will it take... Regarding
> your points above I don't see any added value that this feature
> brings for me as a user of these two libraries, since I'm quite
> happy with the functionality they provide as is. How then the
> developers see it is not up to me to judge.
>
> r//Björn L
>

I'm not sure if we're looking at the same libraries and versions here
but both of these use normal opening tags in the code for quite a
while:
https://github.com/revive-adserver/revive-adserver
https://github.com/smarty-php/smarty

Keywords open source, PHP, and short opening tags don't go together
anymore neither people coding in PHP are using these anymore for a
very long time. If they postpone upgrades and neglect good coding
practices, nothing can help them improve or fix their apps.
-- 
Peter Kokot

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Andrey Andreev
Hello,

I personally am not happy with the outcome of the vote. I think
there's no practical benefit to be gained from the proposal and I
don't even understand what has urged the author to make it; I voted No
on both questions.

However, what's done is done and these post-vote protests are getting
ridiculous. Where were you all during discussion and even during the
voting period? I only remember a single person's rant here and barely
any comments on social media about it ... The people who voted Yes may
have weak arguments ("there's tools out there" isn't a good argument
in my book), they may've underestimated the impact of the change or
they may not even care about it. But they cared enough to drop by and
make their views count, while almost nobody cared enough to come here
and say this isn't right. We don't get to force-reverse a decision
that we didn't care enough for when it mattered.

Cheers,
Andrey.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Björn Larsson

Den 2019-04-24 kl. 19:43, skrev Chase Peeler:

On Wed, Apr 24, 2019 at 1:27 PM Marco Pivetta  wrote:


On Wed, 24 Apr 2019, 19:25 Christian Schneider, 
wrote:


Am 24.04.2019 um 19:13 schrieb Marco Pivetta :

On Wed, 24 Apr 2019, 19:10 Christian Schneider, 
wrote:

Am 24.04.2019 um 19:01 schrieb Peter Kokot :

just a friendly reminder that by the time one writes an email here
these tags can be already replaced with the usual ones.

A friendly reminder that some people are hosting customer code which

they do not want to touch but will get support requests once the code
breaks.

- Chris

That's normal? Everyone has projects to maintain, and breaking changes

are common: they're gonna call you for one anyway: if you don't like

that,

then you are in the wrong line of business.

See Chase Peeler's point: A breaking change should have a reward big
enough to justify it.
And that's what where we (including Zeev Suraski and other core
developers) disagree.

- Chris


Run a fixer: they are out there, and they are extremely stable too.

Also a good chance to finally take a look at code that has been rotting in
a hard drive for too much time.


All of that takes time though. I have 6,787 short opening tags found. Even
if I use a fixer to generate a diff, or, to fix them and then examine the
diff in a pull request... that's going to take a LOT of time. It's going to
start getting messy if I find false positives and need to exclude changes.
It still doesn't address the impact of changes that aren't found. Are you
100% positive that the fixers out there will catch EVERY single instance?
php-cs-fixer doesn't update 

Hi,

I did a quick check on two open source libraries that I'm using,
namely Smarty templating library and Revive ad server. A quick
glance at hand shows that they both uses the http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Mark Randall

On 24/04/2019 21:32, Björn Larsson wrote:
With that experience in mind I wonder how different libraries will fare, 
given this > change? One should also have in mind that there has been a discussion on 
this list about extending the support cycle for PHP 7.4 like for 5.6, but to 
some degree it was rejected which doesn't help migration efforts.


I'm sure Nikita will pop up sometime in the next few days and put his 
recently downloaded 1000+ packages through his parser and give us some 
figures on how many use short open tags, if he hasn't already done so.


I would naturally expect it to be extremely small, after all it makes no 
sense to have a public package which requires a language feature to be 
enabled in the INI and which can't be relied upon.


If there's a problem, it will almost certainly be with internal code, 
which naturally there's a few million times more of, but that seems very 
much in-scope for individual developers to fix if they want to upgrade 
to PHP 8.


My main worry is, and remains, that it's being converted to just a "not 
parser significant" in PHP 8. The potential for unexpected data / code 
leaks is *significant*.


Until someone can convince me otherwise, I will continue to strongly 
believe that foreseeable future (years).


I'm half tempted to RFC it so it can go to a vote.

--
Mark Randall

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Björn Larsson

Den 2019-04-24 kl. 19:55, skrev Stanislav Malyshev:

Hi!


A 68% majority which barely clears the 2/3 requirements for something as
fundamental as that - with so many core devs against it - we'll deserve all
the criticism that will be coming our way in 7.4/8.0 from end users
wondering why we needlessly broke their apps and made migration a bit more
of a headache.

I agree. I think it will be a mistake to do this, and it will hurt a lot
of people upgrading to 7.4, and people who voted "yes" seriously
underestimate how much old code is out there. And the benefit of this
change for the user is virtually non-existant (in fact, one of the
listed benefits - "As such source code may leak if PHP relying on the
short open tags is executed on a configuration where this isn't enabled"
- is exactly the situation that would happen when the RFC is implemented).


Hi,

I recall the discussion about extending the support for 7.4 like we had 
for 5.6, see:

- https://externals.io/message/104581#104807

I read the discussion as it was rejected, but features like this would 
benefit from it,

since not only "inhouse" code will need to adapt but also libraries.

So with this feature we put more weight in the migration bucket, but not 
so much
benefit. Are we then willing to extend the support for PHP 7.4 given 
features like

this? Other BC breaking features will of course also benefit ;-)

r//Björn L

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Björn Larsson

Den 2019-04-24 kl. 16:56, skrev Peter Kokot:

Hello,

On Wed, 24 Apr 2019 at 13:29, G. P. B.  wrote:

Hello Internal,

The two weeks of voting have now ended.
The results are 38 for and 18 against (total 56) for the primary vote to
deprecate PHP's short open tag in PHP 7.4.
This passes in favor with 68%.

The results are 42 for and 15 against (total 57) for the secondary vote to
remove PHP's short open tag in PHP 8.
This passes in favor with 74%.

Thanks for everyone who voted on this issue.

Best regards

George P. Banyard


Great! It was about time this got removed. And it is a perfect timing
also - PHP 8.0 when BC breaking changes can be done. Thank you so much
for moving this forward. People who are thinking of supporting some
legacy applications on the upcoming PHP 8 will be unfortunately a bit
surprised with all the removed features and will have other bigger
issues adjusting their code compared to a really simple replace of 

Hi,

I agree on this to some degree when it comes to your own code that you 
control. But,
imagine a relatively big open source library that is maintained with 
small resources.


One example I have myself is using a relatively large & well established 
open source
library where I'm using the latest version released before Christmas. I 
run the site on
PHP 7.3, but I still get warnings regarding the RFC Counting of 
non-countable objects

for PHP 7.2 related to this library.

With that experience in mind I wonder how different libraries will fare, 
given this
change? One should also have in mind that there has been a discussion on 
this
list about extending the support cycle for PHP 7.4 like for 5.6, but to 
some degree

it was rejected which doesn't help migration efforts.

r//Björn L

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 3:07 PM Peter Kokot  wrote:

> Hello,
>
> On Wed, 24 Apr 2019 at 19:44, Chase Peeler  wrote:
> >
> > On Wed, Apr 24, 2019 at 1:27 PM Marco Pivetta 
> wrote:
> >
> > > On Wed, 24 Apr 2019, 19:25 Christian Schneider,  >
> > > wrote:
> > >
> > > > Am 24.04.2019 um 19:13 schrieb Marco Pivetta :
> > > > > On Wed, 24 Apr 2019, 19:10 Christian Schneider, <
> cschn...@cschneid.com
> > > >
> > > > wrote:
> > > > > Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> > > > > > just a friendly reminder that by the time one writes an email
> here
> > > > > > these tags can be already replaced with the usual ones.
> > > > >
> > > > > A friendly reminder that some people are hosting customer code
> which
> > > > they do not want to touch but will get support requests once the code
> > > > breaks.
> > > > >
> > > > > - Chris
> > > > >
> > > > > That's normal? Everyone has projects to maintain, and breaking
> changes
> > > > are common: they're gonna call you for one anyway: if you don't like
> > > that,
> > > > then you are in the wrong line of business.
> > > >
> > > > See Chase Peeler's point: A breaking change should have a reward big
> > > > enough to justify it.
> > > > And that's what where we (including Zeev Suraski and other core
> > > > developers) disagree.
> > > >
> > > > - Chris
> > > >
> > >
> > > Run a fixer: they are out there, and they are extremely stable too.
> > >
> > > Also a good chance to finally take a look at code that has been
> rotting in
> > > a hard drive for too much time.
> > >
> > All of that takes time though. I have 6,787 short opening tags found.
> Even
> > if I use a fixer to generate a diff, or, to fix them and then examine the
> > diff in a pull request... that's going to take a LOT of time. It's going
> to
> > start getting messy if I find false positives and need to exclude
> changes.
> > It still doesn't address the impact of changes that aren't found. Are you
> > 100% positive that the fixers out there will catch EVERY single instance?
> > php-cs-fixer doesn't update  > dynamic code, then that's not getting caught.
> >
> > The output from php-cs-fixer just generated a diff file that was 161,000
> > lines long. But yea, that's something I can scan through real quick and
> > make sure nothing is going to get broken. No chance I'll miss something
> > either.
> >
> > I would LOVE to have the time to go through our legacy code and clean out
> > old stuff. We have a lot of technical debt that, while we aren't paying
> it
> > off at the moment, it's gaining any interest either. We also have plenty
> > that is. It's tough to justify putting off the stuff that is gaining
> > interest to focus on stuff that isn't so we can fix short tags.
> >
> > I don't work for a software company. I develop an internal application
> for
> > a non-software company. There are 2 other developers and enough work for
> 10
> > developers. It's going to be VERY hard for me to get management to
> approve
> > putting off projects that have a direct impact on our business in order
> to
> > upgrade to PHP 8 when that time comes. I think you are going to find
> that's
> > a pretty common occurrence, and the adoption rate of PHP 8 is going to be
> > VERY low. Especially when more and more user-friendly alternatives like
> > python and node are coming along. It was one thing when the options were
> > RoR, ASP.NET, and JSP. That's not the ecosystem anymore, and it's only
> > going to provide additional user friendly opportunities in the next
> couple
> > of years leading up to PHP8.
> >
> > Can someone PLEASE tell me the positive gains this RFC will accomplish
> that
> > justifies risking:
> > 1.) Losing market share
> > 2.) losing credibility
> > 3.) removing a large number of libraries that are fine from a technical
> > aspect, but will stop working due to the existence of  > 4.) new security risks (code leaks that are more likely than the code
> leaks
> > the RFC seeks to prevent)
> >
> > And, please don't use the existence of code fixers to justify this unless
> > you are willing to demonstrate how it's quick and easy to go through a
> > 161,000 line diff file or are willing to 100% guarantee that the fixer
> will
> > not break anything, will not fix anything it shouldn't, and will not miss
> > anything it should fix.
> >
> >
> >
> >
> >
> > --
> > Chase Peeler
> > chasepee...@gmail.com
>
> I've done few commits with about 8k files changed with very repeating
> changes like this and without breaking anything. It will take you
> about 30minutes... Let's say, one hour for also taking a break from
> all the scrolling the git diff and to return the merge the next day
> after another check or something like this.
>
> The change (speaking for 8k files using short opening tags converted
> to  the memory_limit needs to be increased a bit and only relevant change
> is done in all files. 8k (or 6k) opening tags is nothing very big
> actually.
>
> Honestly, the amount of people that have never seen or worked 

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Peter Kokot
Hello,

On Wed, 24 Apr 2019 at 19:44, Chase Peeler  wrote:
>
> On Wed, Apr 24, 2019 at 1:27 PM Marco Pivetta  wrote:
>
> > On Wed, 24 Apr 2019, 19:25 Christian Schneider, 
> > wrote:
> >
> > > Am 24.04.2019 um 19:13 schrieb Marco Pivetta :
> > > > On Wed, 24 Apr 2019, 19:10 Christian Schneider,  > >
> > > wrote:
> > > > Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> > > > > just a friendly reminder that by the time one writes an email here
> > > > > these tags can be already replaced with the usual ones.
> > > >
> > > > A friendly reminder that some people are hosting customer code which
> > > they do not want to touch but will get support requests once the code
> > > breaks.
> > > >
> > > > - Chris
> > > >
> > > > That's normal? Everyone has projects to maintain, and breaking changes
> > > are common: they're gonna call you for one anyway: if you don't like
> > that,
> > > then you are in the wrong line of business.
> > >
> > > See Chase Peeler's point: A breaking change should have a reward big
> > > enough to justify it.
> > > And that's what where we (including Zeev Suraski and other core
> > > developers) disagree.
> > >
> > > - Chris
> > >
> >
> > Run a fixer: they are out there, and they are extremely stable too.
> >
> > Also a good chance to finally take a look at code that has been rotting in
> > a hard drive for too much time.
> >
> All of that takes time though. I have 6,787 short opening tags found. Even
> if I use a fixer to generate a diff, or, to fix them and then examine the
> diff in a pull request... that's going to take a LOT of time. It's going to
> start getting messy if I find false positives and need to exclude changes.
> It still doesn't address the impact of changes that aren't found. Are you
> 100% positive that the fixers out there will catch EVERY single instance?
> php-cs-fixer doesn't update  dynamic code, then that's not getting caught.
>
> The output from php-cs-fixer just generated a diff file that was 161,000
> lines long. But yea, that's something I can scan through real quick and
> make sure nothing is going to get broken. No chance I'll miss something
> either.
>
> I would LOVE to have the time to go through our legacy code and clean out
> old stuff. We have a lot of technical debt that, while we aren't paying it
> off at the moment, it's gaining any interest either. We also have plenty
> that is. It's tough to justify putting off the stuff that is gaining
> interest to focus on stuff that isn't so we can fix short tags.
>
> I don't work for a software company. I develop an internal application for
> a non-software company. There are 2 other developers and enough work for 10
> developers. It's going to be VERY hard for me to get management to approve
> putting off projects that have a direct impact on our business in order to
> upgrade to PHP 8 when that time comes. I think you are going to find that's
> a pretty common occurrence, and the adoption rate of PHP 8 is going to be
> VERY low. Especially when more and more user-friendly alternatives like
> python and node are coming along. It was one thing when the options were
> RoR, ASP.NET, and JSP. That's not the ecosystem anymore, and it's only
> going to provide additional user friendly opportunities in the next couple
> of years leading up to PHP8.
>
> Can someone PLEASE tell me the positive gains this RFC will accomplish that
> justifies risking:
> 1.) Losing market share
> 2.) losing credibility
> 3.) removing a large number of libraries that are fine from a technical
> aspect, but will stop working due to the existence of  4.) new security risks (code leaks that are more likely than the code leaks
> the RFC seeks to prevent)
>
> And, please don't use the existence of code fixers to justify this unless
> you are willing to demonstrate how it's quick and easy to go through a
> 161,000 line diff file or are willing to 100% guarantee that the fixer will
> not break anything, will not fix anything it shouldn't, and will not miss
> anything it should fix.
>
>
>
>
>
> --
> Chase Peeler
> chasepee...@gmail.com

I've done few commits with about 8k files changed with very repeating
changes like this and without breaking anything. It will take you
about 30minutes... Let's say, one hour for also taking a break from
all the scrolling the git diff and to return the merge the next day
after another check or something like this.

The change (speaking for 8k files using short opening tags converted
to http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator

2019-04-24 Thread M. W. Moe
Hello,

the underlaying discussion here is more important; than just voting yes or
no on uncompleted hamiltonian graphs; the real question here does php8 will
be a break thru; meaning bugger off the mistakes of the past or a
continuation of them; until this RCF does not happen; I would say nothing
interesting will ever happen.

Have a good day.

On Wed, Apr 24, 2019 at 10:25 AM Sara Golemon  wrote:

> On Tue, Apr 23, 2019 at 3:56 AM Nikita Popov  wrote:
>
> > Can't say I understand your position here. Don't want to change the
> > ternary from left-associative to right-associative? I can understand
> that:
> > Silent behavior changes are always problematic. This is not what the RFC
> > proposes though.
> >
> > Did the RFC change since introduction? I may have been looking at a stale
> load of the page (opened it up awhile ago and only just got around to
> responding).
>
> As for what it says atm, I still think it goes too far.  the warning in 7.4
> I can support, but I'm not a fan of breaking existing code on a feature
> that's this old. Ratchet up the warning in 8.0 if you'd like, but error is
> further than I'm willing to go on this one.
>
>
> > 20 years of code in the wild has not "accepted that fact and moved on".
> If
> > a left-associative ternary is used, it is almost certainly a bug. If
> people
> > use this structure by accident (because it is familiar from other
> > programming languages), I'd like them to get an error instead of having
> to
> > figure out why their obviously correct code is not working or, in the
> worse
> > case, just leave behind buggy code.
> >
> > I'm on dismal wifi at the moment, else I'd do some searches, but do you
> have any examples of code in the wild subject to this bug?
> I agree it's a lousy state, but it's not emergent.
>
> -Sara
>


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread M. W. Moe
Hello,

just deprecate it; please stop this load of nonsense; it's not even a
rational discussion here; that's a lot of idiotic rumblings.

Have a good day.

On Wed, Apr 24, 2019 at 11:23 AM Chase Peeler  wrote:

> On Wed, Apr 24, 2019 at 2:20 PM Сергей Пантелеев 
> wrote:
>
> > Hi,
> >
> > >Also imo the reason why people write now (and not in the discussion
> > phase) because for some time in the voting there wasn't the 2/3 majority
> > for the 7.4 (so no sense to clutter the list) and now in the end only 1-2
> > votes make the difference.
> >
> > If this RFC has caused such a resonance _after_ the vote, maybe, it can
> be
> > reopened for a few days so that those who have not voted can do it?
> >
> > Thus, it is not the "1-2 votes" that will matter.
> >
> I think a lot of the people speaking against it, both before and after,
> don’t get a vote.
>
> I think the people that this is going to have the biggest negative impact
> on are the developers out there that don’t even know this mailing lists
> exists, much less this RFC or discussion.
>
>
> > —
> > Sincerely,
> > Sergey Panteleev
> > On 24 Apr 2019, 21:08 +0300, Reinis Rozitis , wrote:
> > > > -Original Message-
> > > > From: Marco Pivetta [mailto:ocram...@gmail.com]
> > > >
> > > > Also a good chance to finally take a look at code that has been
> > rotting in a hard
> > > > drive for too much time.
> > >
> > > It's an odd way of justifying a BC break by saying "you can write this
> > one-liner sed or use this third-party tool to alter you code" exactly the
> > same way every backwards incompatible change can be fixed then .. and
> then
> > it makes no sense to even discuss.
> > >
> > > At the beginning of the proposal it was asked (on mailinglist) if the
> > change has any impact on performance (php runs faster/language parses
> > becomes substantially simple etc), if there are any security issues (like
> > with magic quotes) or maybe similarly as with different extensions there
> is
> > no one to support the code anymore.
> > >
> > > But in the end there is only the ' > documentation discourages short tags because that’s ini specific (while
> > there are bunch of other ini directives which change the the way php
> works
> > (like for example precision)) .. and that's it.
> > >
> > > So instead of by default disabling it and allowing the users make an
> > conscious choice to reenable the option if needed it's removed
> altogether.
> > >
> > >
> > >
> > > Also imo the reason why people write now (and not in the discussion
> > phase) because for some time in the voting there wasn't the 2/3 majority
> > for the 7.4 (so no sense to clutter the list) and now in the end only 1-2
> > votes make the difference.
> > >
> > > rr
> > >
> > >
> > >
> > >
> > > --
> > > PHP Internals - PHP Runtime Development Mailing List
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> --
> Chase Peeler
> chasepee...@gmail.com
>


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 2:20 PM Сергей Пантелеев 
wrote:

> Hi,
>
> >Also imo the reason why people write now (and not in the discussion
> phase) because for some time in the voting there wasn't the 2/3 majority
> for the 7.4 (so no sense to clutter the list) and now in the end only 1-2
> votes make the difference.
>
> If this RFC has caused such a resonance _after_ the vote, maybe, it can be
> reopened for a few days so that those who have not voted can do it?
>
> Thus, it is not the "1-2 votes" that will matter.
>
I think a lot of the people speaking against it, both before and after,
don’t get a vote.

I think the people that this is going to have the biggest negative impact
on are the developers out there that don’t even know this mailing lists
exists, much less this RFC or discussion.


> —
> Sincerely,
> Sergey Panteleev
> On 24 Apr 2019, 21:08 +0300, Reinis Rozitis , wrote:
> > > -Original Message-
> > > From: Marco Pivetta [mailto:ocram...@gmail.com]
> > >
> > > Also a good chance to finally take a look at code that has been
> rotting in a hard
> > > drive for too much time.
> >
> > It's an odd way of justifying a BC break by saying "you can write this
> one-liner sed or use this third-party tool to alter you code" exactly the
> same way every backwards incompatible change can be fixed then .. and then
> it makes no sense to even discuss.
> >
> > At the beginning of the proposal it was asked (on mailinglist) if the
> change has any impact on performance (php runs faster/language parses
> becomes substantially simple etc), if there are any security issues (like
> with magic quotes) or maybe similarly as with different extensions there is
> no one to support the code anymore.
> >
> > But in the end there is only the ' documentation discourages short tags because that’s ini specific (while
> there are bunch of other ini directives which change the the way php works
> (like for example precision)) .. and that's it.
> >
> > So instead of by default disabling it and allowing the users make an
> conscious choice to reenable the option if needed it's removed altogether.
> >
> >
> >
> > Also imo the reason why people write now (and not in the discussion
> phase) because for some time in the voting there wasn't the 2/3 majority
> for the 7.4 (so no sense to clutter the list) and now in the end only 1-2
> votes make the difference.
> >
> > rr
> >
> >
> >
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
-- 
Chase Peeler
chasepee...@gmail.com


RE: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Сергей Пантелеев
Hi,

>Also imo the reason why people write now (and not in the discussion phase) 
>because for some time in the voting there wasn't the 2/3 majority for the 7.4 
>(so no sense to clutter the list) and now in the end only 1-2 votes make the 
>difference.

If this RFC has caused such a resonance _after_ the vote, maybe, it can be 
reopened for a few days so that those who have not voted can do it?

Thus, it is not the "1-2 votes" that will matter.

—
Sincerely,
Sergey Panteleev
On 24 Apr 2019, 21:08 +0300, Reinis Rozitis , wrote:
> > -Original Message-
> > From: Marco Pivetta [mailto:ocram...@gmail.com]
> >
> > Also a good chance to finally take a look at code that has been rotting in 
> > a hard
> > drive for too much time.
>
> It's an odd way of justifying a BC break by saying "you can write this 
> one-liner sed or use this third-party tool to alter you code" exactly the 
> same way every backwards incompatible change can be fixed then .. and then it 
> makes no sense to even discuss.
>
> At the beginning of the proposal it was asked (on mailinglist) if the change 
> has any impact on performance (php runs faster/language parses becomes 
> substantially simple etc), if there are any security issues (like with magic 
> quotes) or maybe similarly as with different extensions there is no one to 
> support the code anymore.
>
> But in the end there is only the ' discourages short tags because that’s ini specific (while there are bunch of 
> other ini directives which change the the way php works (like for example 
> precision)) .. and that's it.
>
> So instead of by default disabling it and allowing the users make an 
> conscious choice to reenable the option if needed it's removed altogether.
>
>
>
> Also imo the reason why people write now (and not in the discussion phase) 
> because for some time in the voting there wasn't the 2/3 majority for the 7.4 
> (so no sense to clutter the list) and now in the end only 1-2 votes make the 
> difference.
>
> rr
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>


Re: [PHP-DEV] Re: [VOTE] Deprecate left-associative ternary

2019-04-24 Thread Nikita Popov
On Wed, Apr 24, 2019 at 6:29 PM Paul M. Jones  wrote:

> Hi all,
>
>
> > On Apr 24, 2019, at 11:27, Nikita Popov  wrote:
> >
> > To better judge the BC impact here, I've analyzed the top 1000 composer
> > packages for this pattern. The results are here:
> > https://gist.github.com/nikic/b6214f87b0e4a7c6fe26919ac849194f
>
> I *love* research like this. Really nicely done. Can you share how you
> accomplished it?
>

Sure, here are the scripts I used:
https://gist.github.com/nikic/a2bfa3e2f604f66115c3e4b8963a6c72

This downloads zipballs for the top composer packages, extracts them, and
uses PHP-Parser to check for uses of ternaries affected by this RFC.

Nikita


RE: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Reinis Rozitis
> -Original Message-
> From: Marco Pivetta [mailto:ocram...@gmail.com]
>
> Also a good chance to finally take a look at code that has been rotting in a 
> hard
> drive for too much time.

It's an odd way of justifying a BC break by saying "you can write this 
one-liner sed or use this third-party tool to alter you code" exactly the same 
way every backwards incompatible change can be fixed then .. and then it makes 
no sense to even discuss.

At the beginning of the proposal it was asked (on mailinglist) if the change 
has any impact on performance (php runs faster/language parses becomes 
substantially simple etc), if there are any security issues (like with magic 
quotes) or maybe similarly as with different extensions there is no one to 
support the code anymore.

But in the end there is only the 'http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Stanislav Malyshev
Hi!

> A 68% majority which barely clears the 2/3 requirements for something as
> fundamental as that - with so many core devs against it - we'll deserve all
> the criticism that will be coming our way in 7.4/8.0 from end users
> wondering why we needlessly broke their apps and made migration a bit more
> of a headache.

I agree. I think it will be a mistake to do this, and it will hurt a lot
of people upgrading to 7.4, and people who voted "yes" seriously
underestimate how much old code is out there. And the benefit of this
change for the user is virtually non-existant (in fact, one of the
listed benefits - "As such source code may leak if PHP relying on the
short open tags is executed on a configuration where this isn't enabled"
- is exactly the situation that would happen when the RFC is implemented).

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 1:27 PM Marco Pivetta  wrote:

> On Wed, 24 Apr 2019, 19:25 Christian Schneider, 
> wrote:
>
> > Am 24.04.2019 um 19:13 schrieb Marco Pivetta :
> > > On Wed, 24 Apr 2019, 19:10 Christian Schneider,  >
> > wrote:
> > > Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> > > > just a friendly reminder that by the time one writes an email here
> > > > these tags can be already replaced with the usual ones.
> > >
> > > A friendly reminder that some people are hosting customer code which
> > they do not want to touch but will get support requests once the code
> > breaks.
> > >
> > > - Chris
> > >
> > > That's normal? Everyone has projects to maintain, and breaking changes
> > are common: they're gonna call you for one anyway: if you don't like
> that,
> > then you are in the wrong line of business.
> >
> > See Chase Peeler's point: A breaking change should have a reward big
> > enough to justify it.
> > And that's what where we (including Zeev Suraski and other core
> > developers) disagree.
> >
> > - Chris
> >
>
> Run a fixer: they are out there, and they are extremely stable too.
>
> Also a good chance to finally take a look at code that has been rotting in
> a hard drive for too much time.
>
All of that takes time though. I have 6,787 short opening tags found. Even
if I use a fixer to generate a diff, or, to fix them and then examine the
diff in a pull request... that's going to take a LOT of time. It's going to
start getting messy if I find false positives and need to exclude changes.
It still doesn't address the impact of changes that aren't found. Are you
100% positive that the fixers out there will catch EVERY single instance?
php-cs-fixer doesn't update 

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Marco Pivetta
On Wed, 24 Apr 2019, 19:25 Christian Schneider, 
wrote:

> Am 24.04.2019 um 19:13 schrieb Marco Pivetta :
> > On Wed, 24 Apr 2019, 19:10 Christian Schneider, 
> wrote:
> > Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> > > just a friendly reminder that by the time one writes an email here
> > > these tags can be already replaced with the usual ones.
> >
> > A friendly reminder that some people are hosting customer code which
> they do not want to touch but will get support requests once the code
> breaks.
> >
> > - Chris
> >
> > That's normal? Everyone has projects to maintain, and breaking changes
> are common: they're gonna call you for one anyway: if you don't like that,
> then you are in the wrong line of business.
>
> See Chase Peeler's point: A breaking change should have a reward big
> enough to justify it.
> And that's what where we (including Zeev Suraski and other core
> developers) disagree.
>
> - Chris
>

Run a fixer: they are out there, and they are extremely stable too.

Also a good chance to finally take a look at code that has been rotting in
a hard drive for too much time.


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Christian Schneider
Am 24.04.2019 um 19:13 schrieb Marco Pivetta :
> On Wed, 24 Apr 2019, 19:10 Christian Schneider,  wrote:
> Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> > just a friendly reminder that by the time one writes an email here
> > these tags can be already replaced with the usual ones.
> 
> A friendly reminder that some people are hosting customer code which they do 
> not want to touch but will get support requests once the code breaks.
> 
> - Chris
> 
> That's normal? Everyone has projects to maintain, and breaking changes are 
> common: they're gonna call you for one anyway: if you don't like that, then 
> you are in the wrong line of business.

See Chase Peeler's point: A breaking change should have a reward big enough to 
justify it.
And that's what where we (including Zeev Suraski and other core developers) 
disagree.

- Chris


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator

2019-04-24 Thread Sara Golemon
On Tue, Apr 23, 2019 at 3:56 AM Nikita Popov  wrote:

> Can't say I understand your position here. Don't want to change the
> ternary from left-associative to right-associative? I can understand that:
> Silent behavior changes are always problematic. This is not what the RFC
> proposes though.
>
> Did the RFC change since introduction? I may have been looking at a stale
load of the page (opened it up awhile ago and only just got around to
responding).

As for what it says atm, I still think it goes too far.  the warning in 7.4
I can support, but I'm not a fan of breaking existing code on a feature
that's this old. Ratchet up the warning in 8.0 if you'd like, but error is
further than I'm willing to go on this one.


> 20 years of code in the wild has not "accepted that fact and moved on". If
> a left-associative ternary is used, it is almost certainly a bug. If people
> use this structure by accident (because it is familiar from other
> programming languages), I'd like them to get an error instead of having to
> figure out why their obviously correct code is not working or, in the worse
> case, just leave behind buggy code.
>
> I'm on dismal wifi at the moment, else I'd do some searches, but do you
have any examples of code in the wild subject to this bug?
I agree it's a lousy state, but it's not emergent.

-Sara


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 1:10 PM Christian Schneider 
wrote:

> Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> > just a friendly reminder that by the time one writes an email here
> > these tags can be already replaced with the usual ones.
>
> A friendly reminder that some people are hosting customer code which they
> do not want to touch but will get support requests once the code breaks.
>
> Whether we are fixing it proactively or reactively, the bottom line is
that we're making modifications to code that don't fix a bug or provide an
enhancement. It involves risk with no reward.


> - Chris
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Chase Peeler
chasepee...@gmail.com


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Marco Pivetta
On Wed, 24 Apr 2019, 19:10 Christian Schneider, 
wrote:

> Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> > just a friendly reminder that by the time one writes an email here
> > these tags can be already replaced with the usual ones.
>
> A friendly reminder that some people are hosting customer code which they
> do not want to touch but will get support requests once the code breaks.
>
> - Chris
>

That's normal? Everyone has projects to maintain, and breaking changes are
common: they're gonna call you for one anyway: if you don't like that, then
you are in the wrong line of business.

>


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Christian Schneider
Am 24.04.2019 um 19:01 schrieb Peter Kokot :
> just a friendly reminder that by the time one writes an email here
> these tags can be already replaced with the usual ones.

A friendly reminder that some people are hosting customer code which they do 
not want to touch but will get support requests once the code breaks.

- Chris


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Peter Kokot
Hello,

just a friendly reminder that by the time one writes an email here
these tags can be already replaced with the usual ones. Here is an
example of running php-cs-fixer to replace the legacy tags to the full
opening tags:

php-cs-fixer fix --rules=full_opening_tag --diff --dry-run
/path/to/php/files/with/short/tags


And then actually replacing them (without dry run):

php-cs-fixer fix --rules=full_opening_tag --diff
/path/to/php/files/with/short/tags

-- 
Peter Kokot

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Lester Caine

On 24/04/2019 16:07, Stephen Reay wrote:

Or use an IDE that has built-in support for inspections/fixing like this, or, as I 
said, run sed over your project files. Replacing ‘

But why should I have to bother at all?

As others have indicated  in templates is tidier and HAVING to add 
thousands of 'php' to the templates serves no purpose other than bowing 
to other peoples coding styles! There are other easier ways of shooting 
myself in the foot especially since 

--
Lester Caine - G8HFL
-
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Mark Randall

On 24/04/2019 17:14, Chase Peeler wrote:

As I've mentioned in other posts, I don't trust this to do a blind

find/replace. Some of our legacy code files are REALLY bad. Just doing auto
formatting on them in PhpStorm will break things.


I believe you may be misinterpreting how these tools work. It's not a 
text based find / replace.


Instead, each PHP file is being fully tokenised just as the PHP parser 
would (in some cases, it is the PHP parser itself doing it) and then the 
short tags are being replaced, and the file reassembled.


The only points you would have to be wary of would be if you were 
computer-generating code, as it would not pick up literals.


--
Mark Randall

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re: [PHP-DEV] [VOTE] Deprecate left-associative ternary

2019-04-24 Thread Paul Jones
Hi all,


> On Apr 24, 2019, at 11:27, Nikita Popov  wrote:
> 
> To better judge the BC impact here, I've analyzed the top 1000 composer
> packages for this pattern. The results are here:
> https://gist.github.com/nikic/b6214f87b0e4a7c6fe26919ac849194f

I *love* research like this. Really nicely done. Can you share how you 
accomplished it?


-- 
Paul M. Jones
pmjo...@pmjones.io
http://paul-m-jones.com

Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp

Solving the N+1 Problem in PHP
https://leanpub.com/sn1php


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: [VOTE] Deprecate left-associative ternary

2019-04-24 Thread Nikita Popov
On Tue, Apr 23, 2019 at 10:43 AM Nikita Popov  wrote:

> Hi internals,
>
> I've opened voting on the RFC to deprecate & remove left associative
> ternary without explicit parentheses. The vote ends 2019-05-07:
>
> https://wiki.php.net/rfc/ternary_associativity
>
> The RFC stays as originally proposed: The associativity of the ternary
> will *not* be changed to right-associative in PHP 8, only the
> left-associative use without disambiguating parentheses becomes an error.
>
> Regards,
> Nikita
>

To better judge the BC impact here, I've analyzed the top 1000 composer
packages for this pattern. The results are here:
https://gist.github.com/nikic/b6214f87b0e4a7c6fe26919ac849194f

The tl;dr is that nested ternaries were used a total of 12 times across all
files. 9 of these uses are bugs: A right-associative meaning was intended,
but PHP will interpret left-associatively. 3 uses of the form $a ? $b : $c
?: $d are potentially okay, because the difference between the two
interpretations is small and it's not obvious to me which one is actually
intended.

Nikita


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Lester Caine

On 24/04/2019 17:04, Peter Bowyer wrote:

Surely the time for vocal opposition was _before_ voting closed?

And actually having a vote would help ...

--
Lester Caine - G8HFL
-
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 12:06 PM Mark Randall  wrote:

> On 24/04/2019 15:35, Chase Peeler wrote:
> >> Total files scanned:  20,767
> > Total lines scanned:  4,013,170
> > Total short open tag references:  6,787
> > Total files w/ short open tag references:  1,665
>
> 1. Open project in PHPStorm (or equivalent).
>
> 2. Run inspections.
>
> 3. Click convert short open tags.
>
> As I've mentioned in other posts, I don't trust this to do a blind
find/replace. Some of our legacy code files are REALLY bad. Just doing auto
formatting on them in PhpStorm will break things.


> Personally I prefer the shorter look of "" when writing
> templates, but not enough to be up in arms about its removal.
>
> I personally don't like using short tags. I haven't used them since there
was a rumor they would be removed in PHP 6. My objections have nothing to
do with me personally wanting to keep using short tags.


> If anything I'm more concerned about potential code + data leaks.
>
> One of my major concerns as well. I find it ironic that one of the
justifications for the RFC was the potential for code leaks if code with
short open tags is used in an environment where short open tags are
disabled. The solution to that was to guarantee that code with short open
tags will leak code.


> Something which was previously perfectly legitimate code, no longer
> being considered code, could be quite the problematic situation...
> especially if that code happened to be protective logic such as "if"
> statements.
>
> Exactly my point. Much of our legacy code is left alone as much as
possible. We go in there when absolutely necessary due to functional
changes in our applications. This change forces us to go in there for
changes that don't relate to application functions and don't provide any
meaningful enhancement to the language itself, either.


> 
>User secret: 
> 
>
> I would have preferred that the parser encountering  error for quite some time rather than just magically ceasing to be
> relevant.
>
> I agree. I think showing a blank page would be better than leaking code.


> The XML argument holds no weight with me.
>
> Me either. I definitely don't think it is serious enough to justify the BC
break given that it can be easily worked around.


> --
> Mark Randall
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Chase Peeler
chasepee...@gmail.com


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 12:03 PM Thomas Bley  wrote:

> Hello,
>
> I understand that breaking changes always need extra work, but in this
> case I think it's a quick change. On my code base (mostly legacy with 1.8m
> lines), I ran this and got 10 matches to check:
>
> Awesome. I got 6,787 over 4m lines.


> grep -rin " -v "\.js:"
>
> Regards
> Thomas
>
> > vsura...@gmail.com hat am 24. April 2019 um 15:41 geschrieben:
> >
> >
> > FWIW,
> >
> > I think it's a bad decision, made against the thoughts of clear majority
> of core developers - and for hardly a good reason. I believe it illustrates
> very well why we need to properly define our voting eligibility rules, and
> I hope someone would be up to the challenge of tackling it (I decided not
> to pursue it further after the 'abolish' RFC(s)).
> >
> > A 68% majority which barely clears the 2/3 requirements for something as
> fundamental as that - with so many core devs against it - we'll deserve all
> the criticism that will be coming our way in 7.4/8.0 from end users
> wondering why we needlessly broke their apps and made migration a bit more
> of a headache.
> >
> > My 2c.
> >
> > Zeev
> >
> >
> > -Original Message-
> > From: G. P. B. 
> > Sent: Wednesday, April 24, 2019 2:29 PM
> > To: PHP internals 
> > Subject: Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags
> >
> > Hello Internal,
> >
> > The two weeks of voting have now ended.
> > The results are 38 for and 18 against (total 56) for the primary vote to
> deprecate PHP's short open tag in PHP 7.4.
> > This passes in favor with 68%.
> >
> > The results are 42 for and 15 against (total 57) for the secondary vote
> to remove PHP's short open tag in PHP 8.
> > This passes in favor with 74%.
> >
> > Thanks for everyone who voted on this issue.
> >
> > Best regards
> >
> > George P. Banyard
> >
> > >
> >
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Chase Peeler
chasepee...@gmail.com


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Mark Randall

On 24/04/2019 15:35, Chase Peeler wrote:

Total files scanned:  20,767

Total lines scanned:  4,013,170
Total short open tag references:  6,787
Total files w/ short open tag references:  1,665


1. Open project in PHPStorm (or equivalent).

2. Run inspections.

3. Click convert short open tags.

Personally I prefer the shorter look of "" when writing 
templates, but not enough to be up in arms about its removal.


If anything I'm more concerned about potential code + data leaks.

Something which was previously perfectly legitimate code, no longer 
being considered code, could be quite the problematic situation... 
especially if that code happened to be protective logic such as "if" 
statements.



  User secret: 


I would have preferred that the parser encountering error for quite some time rather than just magically ceasing to be 
relevant.


The XML argument holds no weight with me.

--
Mark Randall

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 12:04 PM Peter Bowyer  wrote:

> Surely the time for vocal opposition was _before_ voting closed?
>
> And I raised my opposition multiple times. That included one email where I
laid out a case for why each reason listed for the RFC did not justify the
major BC break. No one ever responded to even one of those points.


> Peter
>
> On Wed, 24 Apr 2019 at 16:51, Chase Peeler  wrote:
>
>> On Wed, Apr 24, 2019 at 11:27 AM Stephen Reay 
>> wrote:
>>
>> >
>> > > On 24 Apr 2019, at 22:16, Chase Peeler  wrote:
>> > >
>> > >
>> > >
>> > > On Wed, Apr 24, 2019 at 11:02 AM Stephen Reay <
>> php-li...@koalephant.com
>> > > wrote:
>> > >
>> > > > On 24 Apr 2019, at 21:35, Chase Peeler > > > chasepee...@gmail.com>> wrote:
>> > > >
>> > > > If I get started now, maybe I can have everything fixed by the time
>> > 8.1 is
>> > > > released.
>> > >
>> > >
>> > > Two characters less than this sentence of yours is a 1-liner find/sed
>> > script to replace all `> > > Would you really feel confident doing a blind find/replace on 6,000+
>> > instances?
>> >
>> > It’s hardly “blind”. This is what version control is for. You make a
>> > change, and then either view the diff locally, and/or commit/push it,
>> and
>> > ask others to help review the diff.
>> >
>> > I literally just ran the script referenced above on a client project,
>> > eyeballed the diff, and committed the changes it made to a branch. Once
>> I’m
>> > not in the middle of anything I’ll review it again and then merge it.
>> >
>> > How big of a project? How many changes? You really think 6,787 changes
>> among 1,656 files can just be eyeballed?
>>
>>
>> > >
>> > > what about > that
>> > in my code, though.
>> >
>> > So change the pattern to replace `> > equals sign.
>> >
>> >  > of
>> string (inside quotes, heredoc, etc). Even that could be a legitimate
>> case,
>> though, if something is using eval, god forbid. '> replacement with '> '>
>>
>> > >
>> > > What if I utilize a 3rd party library that, while no longer support,
>> > works fine, but is now broken for no other reason than the fact that > is
>> > no longer supported? Whether I should be using that library or not is
>> > irrelevant. The fact is, I am, and the fact that I won't be able to use
>> it
>> > in 8.0 is a barrier to me upgrading.
>> > >
>> >
>> > You do the same thing as if the library had a security issue or some
>> other
>> > bug. If it’s unsupported, you have to support it, or you have to find a
>> > replacement. It’s not like you’re dealing with a compiled module that
>> you
>> > can’t edit. Run the same fix for short tags on the library.
>> >
>> > All valid options. Doesn't change the fact that it's more code to update
>> meaning more time required to prepare for the upgrade.
>>
>>
>> > > I don't trust mass find/replace tools like php-cs-fixer. Some of our
>> > legacy code is really ugly. Auto-formatting with PhpStorm will break
>> it. I
>> > don't mind using an interactive tool, but that means I have to sit there
>> > and hit Y or N for 6,787 instances. Some of them will probably require
>> me
>> > to actually open the file up and check out the surrounding context as
>> well.
>> > And, what happens if I miss one? I run the risk of code leak.
>> >
>> > If auto formatting ‘breaks’ your code, you have a bigger problem than
>> > short tags.
>> >
>> > I never said that our code was good. Most of our legacy code isn't ever
>> touched. It's a mess of 10k+ line spaghetti files. It works, and until we
>> are able to replace it, we just leave it alone. Now we are forced to go in
>> there and mess with it for something that doesn't even pertain to the
>> functionality of our application.
>>
>> Also, you didn't address the issue of missed instances. There is no way to
>> be 100% sure any automated or manual process of replacing the tags will
>> get
>> everything. One of the justifications for this RFC was the possibility of
>> code leak if code with short tags is loaded in an environment that has
>> short tags disabled. We've decided to fix that by making sure that any
>> code
>> with short tags will DEFINITELY leak code. That makes a lot of sense.
>> Eyeballing a diff isn't going to help you find missed instances either.
>>
>>
>> > >
>> > > I think it's great that many of you have code bases that are in pretty
>> > good shape and this change isn't going to have much of an impact on you.
>> > That's not my case, though. It's not the case for a LOT of people. I'm
>> not
>> > against BC breaks - even major ones - if they are justified. I have yet
>> to
>> > see any good justifications for such a massive BC break.
>> > >
>> > > The fact is that this change WILL prevent a lot of people from being
>> > able to upgrade to 8.0 in a timely manner. Anyone that has to justify
>> > spending time to prepare for an upgrade to people that don't understand
>> the
>> > benefits of the upgrade will have an ever harder time trying to justify
>> the
>> > extra time 

RE: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Thomas Bley
Hello,

I understand that breaking changes always need extra work, but in this case I 
think it's a quick change. On my code base (mostly legacy with 1.8m lines), I 
ran this and got 10 matches to check:

grep -rin " vsura...@gmail.com hat am 24. April 2019 um 15:41 geschrieben:
> 
> 
> FWIW,
> 
> I think it's a bad decision, made against the thoughts of clear majority of 
> core developers - and for hardly a good reason. I believe it illustrates very 
> well why we need to properly define our voting eligibility rules, and I hope 
> someone would be up to the challenge of tackling it (I decided not to pursue 
> it further after the 'abolish' RFC(s)).
> 
> A 68% majority which barely clears the 2/3 requirements for something as 
> fundamental as that - with so many core devs against it - we'll deserve all 
> the criticism that will be coming our way in 7.4/8.0 from end users wondering 
> why we needlessly broke their apps and made migration a bit more of a 
> headache.
> 
> My 2c.
> 
> Zeev
> 
> 
> -Original Message-
> From: G. P. B.  
> Sent: Wednesday, April 24, 2019 2:29 PM
> To: PHP internals 
> Subject: Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags
> 
> Hello Internal,
> 
> The two weeks of voting have now ended.
> The results are 38 for and 18 against (total 56) for the primary vote to 
> deprecate PHP's short open tag in PHP 7.4.
> This passes in favor with 68%.
> 
> The results are 42 for and 15 against (total 57) for the secondary vote to 
> remove PHP's short open tag in PHP 8.
> This passes in favor with 74%.
> 
> Thanks for everyone who voted on this issue.
> 
> Best regards
> 
> George P. Banyard
> 
> >
> 
> 
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 11:27 AM Stephen Reay 
wrote:

>
> > On 24 Apr 2019, at 22:16, Chase Peeler  wrote:
> >
> >
> >
> > On Wed, Apr 24, 2019 at 11:02 AM Stephen Reay  > wrote:
> >
> > > On 24 Apr 2019, at 21:35, Chase Peeler  chasepee...@gmail.com>> wrote:
> > >
> > > If I get started now, maybe I can have everything fixed by the time
> 8.1 is
> > > released.
> >
> >
> > Two characters less than this sentence of yours is a 1-liner find/sed
> script to replace all ` > Would you really feel confident doing a blind find/replace on 6,000+
> instances?
>
> It’s hardly “blind”. This is what version control is for. You make a
> change, and then either view the diff locally, and/or commit/push it, and
> ask others to help review the diff.
>
> I literally just ran the script referenced above on a client project,
> eyeballed the diff, and committed the changes it made to a branch. Once I’m
> not in the middle of anything I’ll review it again and then merge it.
>
> How big of a project? How many changes? You really think 6,787 changes
among 1,656 files can just be eyeballed?


> >
> > what about  in my code, though.
>
> So change the pattern to replace ` equals sign.
>
>   >
> > What if I utilize a 3rd party library that, while no longer support,
> works fine, but is now broken for no other reason than the fact that  no longer supported? Whether I should be using that library or not is
> irrelevant. The fact is, I am, and the fact that I won't be able to use it
> in 8.0 is a barrier to me upgrading.
> >
>
> You do the same thing as if the library had a security issue or some other
> bug. If it’s unsupported, you have to support it, or you have to find a
> replacement. It’s not like you’re dealing with a compiled module that you
> can’t edit. Run the same fix for short tags on the library.
>
> All valid options. Doesn't change the fact that it's more code to update
meaning more time required to prepare for the upgrade.


> > I don't trust mass find/replace tools like php-cs-fixer. Some of our
> legacy code is really ugly. Auto-formatting with PhpStorm will break it. I
> don't mind using an interactive tool, but that means I have to sit there
> and hit Y or N for 6,787 instances. Some of them will probably require me
> to actually open the file up and check out the surrounding context as well.
> And, what happens if I miss one? I run the risk of code leak.
>
> If auto formatting ‘breaks’ your code, you have a bigger problem than
> short tags.
>
> I never said that our code was good. Most of our legacy code isn't ever
touched. It's a mess of 10k+ line spaghetti files. It works, and until we
are able to replace it, we just leave it alone. Now we are forced to go in
there and mess with it for something that doesn't even pertain to the
functionality of our application.

Also, you didn't address the issue of missed instances. There is no way to
be 100% sure any automated or manual process of replacing the tags will get
everything. One of the justifications for this RFC was the possibility of
code leak if code with short tags is loaded in an environment that has
short tags disabled. We've decided to fix that by making sure that any code
with short tags will DEFINITELY leak code. That makes a lot of sense.
Eyeballing a diff isn't going to help you find missed instances either.


> >
> > I think it's great that many of you have code bases that are in pretty
> good shape and this change isn't going to have much of an impact on you.
> That's not my case, though. It's not the case for a LOT of people. I'm not
> against BC breaks - even major ones - if they are justified. I have yet to
> see any good justifications for such a massive BC break.
> >
> > The fact is that this change WILL prevent a lot of people from being
> able to upgrade to 8.0 in a timely manner. Anyone that has to justify
> spending time to prepare for an upgrade to people that don't understand the
> benefits of the upgrade will have an ever harder time trying to justify the
> extra time necessary. I also think you are going to find a good number of
> people that will upgrade (or use PHP for the first time) unaware of the
> change. They'll attempt to load older code that has short tags in it. It
> won't work. They'll say "screw it" and use python or node.
> > --
> > Chase Peeler
> > chasepee...@gmail.com 
>
> It's not that I'm against the idea of abolishing short tags. It's that I
don't feel the problems abolishing them will cause are justified by the
reasons given for abolishing them. No matter how easy you think it is to
deal with this, it won't change the fact that it's going to be a barrier to
upgrading for a lot of people. It's going to have a negative impact on 8.0
adoption. It's going to lead to a larger number of people running PHP
versions that have reached EOL. In the end, it's going to hurt the market
share and reputation of PHP.



-- 
Chase Peeler
chasepee...@gmail.com


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Stephen Reay

> On 24 Apr 2019, at 22:16, Chase Peeler  wrote:
> 
> 
> 
> On Wed, Apr 24, 2019 at 11:02 AM Stephen Reay  > wrote:
> 
> > On 24 Apr 2019, at 21:35, Chase Peeler  > > wrote:
> > 
> > If I get started now, maybe I can have everything fixed by the time 8.1 is
> > released.
> 
> 
> Two characters less than this sentence of yours is a 1-liner find/sed script 
> to replace all ` Would you really feel confident doing a blind find/replace on 6,000+ 
> instances?

It’s hardly “blind”. This is what version control is for. You make a change, 
and then either view the diff locally, and/or commit/push it, and ask others to 
help review the diff.

I literally just ran the script referenced above on a client project, eyeballed 
the diff, and committed the changes it made to a branch. Once I’m not in the 
middle of anything I’ll review it again and then merge it.

> 
> what about  code, though.

So change the pattern to replace ` 
> What if I utilize a 3rd party library that, while no longer support, works 
> fine, but is now broken for no other reason than the fact that  longer supported? Whether I should be using that library or not is 
> irrelevant. The fact is, I am, and the fact that I won't be able to use it in 
> 8.0 is a barrier to me upgrading. 
> 

You do the same thing as if the library had a security issue or some other bug. 
If it’s unsupported, you have to support it, or you have to find a replacement. 
It’s not like you’re dealing with a compiled module that you can’t edit. Run 
the same fix for short tags on the library.

> I don't trust mass find/replace tools like php-cs-fixer. Some of our legacy 
> code is really ugly. Auto-formatting with PhpStorm will break it. I don't 
> mind using an interactive tool, but that means I have to sit there and hit Y 
> or N for 6,787 instances. Some of them will probably require me to actually 
> open the file up and check out the surrounding context as well. And, what 
> happens if I miss one? I run the risk of code leak.

If auto formatting ‘breaks’ your code, you have a bigger problem than short 
tags.

> 
> I think it's great that many of you have code bases that are in pretty good 
> shape and this change isn't going to have much of an impact on you. That's 
> not my case, though. It's not the case for a LOT of people. I'm not against 
> BC breaks - even major ones - if they are justified. I have yet to see any 
> good justifications for such a massive BC break. 
> 
> The fact is that this change WILL prevent a lot of people from being able to 
> upgrade to 8.0 in a timely manner. Anyone that has to justify spending time 
> to prepare for an upgrade to people that don't understand the benefits of the 
> upgrade will have an ever harder time trying to justify the extra time 
> necessary. I also think you are going to find a good number of people that 
> will upgrade (or use PHP for the first time) unaware of the change. They'll 
> attempt to load older code that has short tags in it. It won't work. They'll 
> say "screw it" and use python or node. 
> -- 
> Chase Peeler
> chasepee...@gmail.com 




Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 11:02 AM Stephen Reay 
wrote:

>
> > On 24 Apr 2019, at 21:35, Chase Peeler  wrote:
> >
> > If I get started now, maybe I can have everything fixed by the time 8.1
> is
> > released.
>
>
> Two characters less than this sentence of yours is a 1-liner find/sed
> script to replace all `

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Stephen Reay

> On 24 Apr 2019, at 21:56, Lester Caine  wrote:
> 
>  I've looked at these 'automatic tools' and until there is one that does not 
> enforce their own views of code style they are just another nail

While the pre-build rules may not be what you want - something like 
PHP_CodeSniffer will let you just run a single ‘sniff’ type by passing it’s 
name.

Or use an IDE that has built-in support for inspections/fixing like this, or, 
as I said, run sed over your project files. Replacing ‘

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Stephen Reay

> On 24 Apr 2019, at 21:35, Chase Peeler  wrote:
> 
> If I get started now, maybe I can have everything fixed by the time 8.1 is
> released.


Two characters less than this sentence of yours is a 1-liner find/sed script to 
replace all `

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Peter Kokot
Hello,

On Wed, 24 Apr 2019 at 13:29, G. P. B.  wrote:
>
> Hello Internal,
>
> The two weeks of voting have now ended.
> The results are 38 for and 18 against (total 56) for the primary vote to
> deprecate PHP's short open tag in PHP 7.4.
> This passes in favor with 68%.
>
> The results are 42 for and 15 against (total 57) for the secondary vote to
> remove PHP's short open tag in PHP 8.
> This passes in favor with 74%.
>
> Thanks for everyone who voted on this issue.
>
> Best regards
>
> George P. Banyard
>
> >

Great! It was about time this got removed. And it is a perfect timing
also - PHP 8.0 when BC breaking changes can be done. Thank you so much
for moving this forward. People who are thinking of supporting some
legacy applications on the upcoming PHP 8 will be unfortunately a bit
surprised with all the removed features and will have other bigger
issues adjusting their code compared to a really simple replace of http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Lester Caine

On 24/04/2019 15:36, Stephen Reay wrote:

Of all the things to ‘refuse to upgrade’ over this seems pretty silly. There 
are multiple tools that will automatically fix this across an entire codebase 
in seconds. Heck, a sed 1 liner would do it if you want to DIY it.


Another nail rather a reason it it's own right, and I've looked at these 
'automatic tools' and until there is one that does not enforce their own 
views of code style they are just another nail ... it's bad enough when 
tidy TABBED code gets messed up by someone replacing them all with 
multiple spaces because that is 'the proper way to do it' ... this is 
long established coding style issue not simply automatic edits to code 
that IS working perfectly already. It does not 'fixing' simply because 
some people don't like it ...


--
Lester Caine - G8HFL
-
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Stephen Reay


> On 24 Apr 2019, at 21:00, Lester Caine  wrote:
> 
> On 24/04/2019 14:41, vsura...@gmail.com wrote:
>> A 68% majority which barely clears the 2/3 requirements for something as 
>> fundamental as that - with so many core devs against it - we'll deserve all 
>> the criticism that will be coming our way in 7.4/8.0 from end users 
>> wondering why we needlessly broke their apps and made migration a bit more 
>> of a headache.
> 
> This is yet another negative move in my forward planning and just another 
> cross against even bothering with PHP8 ... and PHP7.4 is only going to 
> complain about things so while I've not even started testing on PHP7.3, that 
> is likely to be the last version of PHP I will be using ... once all the 
> warnings are dealt with on PHP7.2 ... I don't think even the carrot of 'JIT' 
> this time trumps being beaten around the head with more and more BC changes 
> we will to have to manage and adding 'php' to every   descriptive text elsewhere.
> 
> -- 
> Lester Caine - G8HFL
> -
> Contact - https://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - https://lsces.co.uk
> EnquirySolve - https://enquirysolve.com/
> Model Engineers Digital Workshop - https://medw.co.uk
> Rainbow Digital Media - https://rainbowdigitalmedia.co.uk
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Of all the things to ‘refuse to upgrade’ over this seems pretty silly. There 
are multiple tools that will automatically fix this across an entire codebase 
in seconds. Heck, a sed 1 liner would do it if you want to DIY it.



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Chase Peeler
On Wed, Apr 24, 2019 at 10:00 AM Lester Caine  wrote:

> On 24/04/2019 14:41, vsura...@gmail.com wrote:
> > A 68% majority which barely clears the 2/3 requirements for something as
> fundamental as that - with so many core devs against it - we'll deserve all
> the criticism that will be coming our way in 7.4/8.0 from end users
> wondering why we needlessly broke their apps and made migration a bit more
> of a headache.
>
> This is yet another negative move in my forward planning and just
> another cross against even bothering with PHP8 ... and PHP7.4 is only
> going to complain about things so while I've not even started testing on
> PHP7.3, that is likely to be the last version of PHP I will be using ...
> once all the warnings are dealt with on PHP7.2 ... I don't think even
> the carrot of 'JIT' this time trumps being beaten around the head with
> more and more BC changes we will to have to manage and adding 'php' to
> every  all the other attempts at removing descriptive text elsewhere.
>
> Total files scanned:  20,767
Total lines scanned:  4,013,170
Total short open tag references:  6,787
Total files w/ short open tag references:  1,665

If I get started now, maybe I can have everything fixed by the time 8.1 is
released.

> --
> Lester Caine - G8HFL
> -
> Contact - https://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - https://lsces.co.uk
> EnquirySolve - https://enquirysolve.com/
> Model Engineers Digital Workshop - https://medw.co.uk
> Rainbow Digital Media - https://rainbowdigitalmedia.co.uk
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Chase Peeler
chasepee...@gmail.com


RE: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Reinis Rozitis
> A 68% majority which barely clears the 2/3 requirements for something as
> fundamental as that - with so many core devs against it - we'll deserve all 
> the
> criticism that will be coming our way in 7.4/8.0 from end users wondering why
> we needlessly broke their apps and made migration a bit more of a headache.

It's quite interesting to check the karma levels for the voters (might be on a 
slippery slope here but it feels a bit unfair that someone with just a 
documentation karma (or no karma at all (at least according to wiki.php.net)) 
has the same weight on a core option getting removed).

p.s. at least for the deprecation stage for 7.4 the revert patch is simple

rr


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Lester Caine

On 24/04/2019 14:41, vsura...@gmail.com wrote:

A 68% majority which barely clears the 2/3 requirements for something as 
fundamental as that - with so many core devs against it - we'll deserve all the 
criticism that will be coming our way in 7.4/8.0 from end users wondering why 
we needlessly broke their apps and made migration a bit more of a headache.


This is yet another negative move in my forward planning and just 
another cross against even bothering with PHP8 ... and PHP7.4 is only 
going to complain about things so while I've not even started testing on 
PHP7.3, that is likely to be the last version of PHP I will be using ... 
once all the warnings are dealt with on PHP7.2 ... I don't think even 
the carrot of 'JIT' this time trumps being beaten around the head with 
more and more BC changes we will to have to manage and adding 'php' to 
every all the other attempts at removing descriptive text elsewhere.


--
Lester Caine - G8HFL
-
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread vsuraski
FWIW,

I think it's a bad decision, made against the thoughts of clear majority of 
core developers - and for hardly a good reason.  I believe it illustrates very 
well why we need to properly define our voting eligibility rules, and I hope 
someone would be up to the challenge of tackling it (I decided not to pursue it 
further after the 'abolish' RFC(s)).

A 68% majority which barely clears the 2/3 requirements for something as 
fundamental as that - with so many core devs against it - we'll deserve all the 
criticism that will be coming our way in 7.4/8.0 from end users wondering why 
we needlessly broke their apps and made migration a bit more of a headache.

My 2c.

Zeev


-Original Message-
From: G. P. B.  
Sent: Wednesday, April 24, 2019 2:29 PM
To: PHP internals 
Subject: Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

Hello Internal,

The two weeks of voting have now ended.
The results are 38 for and 18 against (total 56) for the primary vote to 
deprecate PHP's short open tag in PHP 7.4.
This passes in favor with 68%.

The results are 42 for and 15 against (total 57) for the secondary vote to 
remove PHP's short open tag in PHP 8.
This passes in favor with 74%.

Thanks for everyone who voted on this issue.

Best regards

George P. Banyard

>


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator

2019-04-24 Thread Claude Pache



> Le 24 avr. 2019 à 11:10, Björn Larsson  a écrit :
> 
> Den 2019-04-22 kl. 10:09, skrev Nikita Popov:
>> On Tue, Apr 9, 2019 at 11:54 AM Nikita Popov  wrote:
>> 
>>> Hi internals,
>>> The only objection here came from Gabriel, and I don't think we'll come to
>>> an agreement.
>>> Inspired by Bob's recent RFC for concat precedence, I'd like to propose a
>>> deprecation and removal of the left-associative behavior of ternaries.
>>> Instead, explicit parentheses should be used:
>>> 
>>> https://wiki.php.net/rfc/ternary_The only objection here came from
>>> Gabriel, and I don't think we'll come to an agreement.associativity
>>> 
>>> 
>>> This RFC makes nested ternaries without disambiguating parentheses an
>>> error in PHP 8 -- we might want to consider making them right-associative
>>> instead, which is both useful and matches the behavior of other languages.
>>> 
>>> Regards,
>>> Nikita
>>> 
>> Heads up: Plan to start voting tomorrow.
>> 
>> Apart from Bishop, would anyone else prefer to directly go to right
>> associativity in PHP 8 rather than making it an error? I'm rather partial
>> to that myself, maybe it can be included as a voting option...
>> 
>> Nikita
> 
> Hi,
> 
> I think one should go for the right associativity. 8.x is the right place to
> do it, if at all. Doing it directly in 8.0 has the benefit that when upgrading
> to a major version it justifies an upgrading project for an application and
> one also might get tool support, e.g. the php7mar tool for 7.0 was quite
> valuable. Also IDEs like phpstorm has good support.
> 
> One then has to weigh legacy code versus new code being written with a
> behaviour different from almost all other languages. I'm not sure if this
> is an appropriate example to compare with, but I came to think on the
> PHP 7.0 Uniform Variable Syntax rfc regarding migration effort and BC
> impact.
> 
> r//Björn L
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

If you go for right-associative straight in PHP 8, you make it mandatory to use 
a static analysis tool for:

* migrating code from one major version to the next;
* maintaining a library that aims to run in two major consecutive versions.

Although that might be a no-brainer for anyone following internals, I doubt it 
is the case for anyone writing PHP.

With a more step-wise approach (left-associative in PHP 7, non-associative in 
PHP 8, right-associative in PHP 9 or 10), the situation is much safer and 
simpler: you can’t even compile the code in at least one of the consecutive 
major versions you aim to support, and the error message says exactly what and 
where you have to fix in order to make it working.

As says an Italian proverb: chi va piano, va sano e lontano.

—Claude



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread G. P. B.
 On Wed, 24 Apr 2019 at 14:20, Andreas Hennings  wrote:

> Hello list,
> I assume this is only about  I do not see this distinction mentioned in the RFC, perhaps I missed it? I
> think it would be useful to make this explicit, to avoid possible
> confusion.
>
> G. P. B.  schrieb am Mi., 24. Apr. 2019, 13:29:
>
>> Hello Internal,
>>
>> The two weeks of voting have now ended.
>> The results are 38 for and 18 against (total 56) for the primary vote to
>> deprecate PHP's short open tag in PHP 7.4.
>> This passes in favor with 68%.
>>
>> The results are 42 for and 15 against (total 57) for the secondary vote to
>> remove PHP's short open tag in PHP 8.
>> This passes in favor with 74%.
>>
>> Thanks for everyone who voted on this issue.
>>
>> Best regards
>>
>> George P. Banyard
>>
>> >
>>
>
This is indeed only for the https://wiki.php.net/rfc/deprecate_php_short_tags


Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread G. P. B.
Hello Internal,

The two weeks of voting have now ended.
The results are 38 for and 18 against (total 56) for the primary vote to
deprecate PHP's short open tag in PHP 7.4.
This passes in favor with 68%.

The results are 42 for and 15 against (total 57) for the secondary vote to
remove PHP's short open tag in PHP 8.
This passes in favor with 74%.

Thanks for everyone who voted on this issue.

Best regards

George P. Banyard

>


Re: [PHP-DEV] Object Type Casting Reloaded

2019-04-24 Thread Michał Brzuchalski
wt., 23 kwi 2019 o 11:17 Nikita Popov  napisał(a):

> ...
> Without commenting on the rest of the proposal: It's not possible to use
> (ClassName) as a cast syntax, because it is ambiguous. For example (Foo)
> [$x] is already valid syntax (fetch constant Foo and take index $x), or
> (Foo) +$bar, etc.
>

Wouldn't that be possible to differentiate consts with class names if we
merge symbol tables and allow only one symbol with the same name?

I know this is huge BC break but AFAIK in the past, there was a discussion
about merging symbol tables.

-- 
regards / pozdrawiam,
--
Michał Brzuchalski
about.me/brzuchal
brzuchalski.com


Re: [PHP-DEV] Re: [RFC] Deprecate left-associative ternary operator

2019-04-24 Thread Björn Larsson

Den 2019-04-22 kl. 10:09, skrev Nikita Popov:

On Tue, Apr 9, 2019 at 11:54 AM Nikita Popov  wrote:


Hi internals,
The only objection here came from Gabriel, and I don't think we'll come to
an agreement.
Inspired by Bob's recent RFC for concat precedence, I'd like to propose a
deprecation and removal of the left-associative behavior of ternaries.
Instead, explicit parentheses should be used:

https://wiki.php.net/rfc/ternary_The only objection here came from
Gabriel, and I don't think we'll come to an agreement.associativity


This RFC makes nested ternaries without disambiguating parentheses an
error in PHP 8 -- we might want to consider making them right-associative
instead, which is both useful and matches the behavior of other languages.

Regards,
Nikita


Heads up: Plan to start voting tomorrow.

Apart from Bishop, would anyone else prefer to directly go to right
associativity in PHP 8 rather than making it an error? I'm rather partial
to that myself, maybe it can be included as a voting option...

Nikita


Hi,

I think one should go for the right associativity. 8.x is the right place to
do it, if at all. Doing it directly in 8.0 has the benefit that when 
upgrading

to a major version it justifies an upgrading project for an application and
one also might get tool support, e.g. the php7mar tool for 7.0 was quite
valuable. Also IDEs like phpstorm has good support.

One then has to weigh legacy code versus new code being written with a
behaviour different from almost all other languages. I'm not sure if this
is an appropriate example to compare with, but I came to think on the
PHP 7.0 Uniform Variable Syntax rfc regarding migration effort and BC
impact.

r//Björn L

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php