Re: [PHP-DEV] RFC: Trait expects interface

2022-01-07 Thread Robert Korulczyk
(): string { return 't'; } } This proposal gives you tools to ensure that class does not mess up with method signatures expected by trait - you can create pairs of trait-interface and require interface in trait. -- Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Developme

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Robert Korulczyk
s to define its purpose and ensure that classes have proper definition. -- Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Robert Korulczyk
t; detection. At the same time navigation between classes and interfaces worked without any problem. -- Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Robert Korulczyk
se it depends on class where it is used). And finally, you could use `{@inheritdoc}` in some meaningful way in traits - right now there is no straightforward way to inherit phpdoc from the interface, and often this is what you want to do. -- Regards, Robert Korulczyk -- PHP Internals

Re: [PHP-DEV] [RFC] Property accessors

2021-05-04 Thread Robert Korulczyk
y generated from string. It would be great to handle this too, even if it will be only syntactic sugar, where `$object->property['key'] = 'value';` will be equivalent of this dance: $temp = $object->property; $temp['key'] = 'value'; $object->property = $temp; Regards, Robert Korulczyk

Re: [PHP-DEV] [RFC] Reclassifying engine warnings

2019-09-13 Thread Robert Korulczyk
d to know previous value (or its type) to overwrite it (it does not matter what is $foo[$key1] value if you do `$foo[$key1] = 1` - it works similar to `$foo = 1`); Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Reclassifying engine warnings

2019-09-13 Thread Robert Korulczyk
unnecessary errors. Well, then let's say that it is "lesser evil" - one additional line is better than ignoring reading uninitialized values. And IMO it is not a "problem" that would justify introducing special syntax for saving one line in such niche case. Regards, Robert Korulc

Re: [PHP-DEV] Changing fundamental language behaviors

2019-09-13 Thread Robert Korulczyk
mbs - unmaintained extensions with possible security issues. Right now the biggest problem of WordPress ecosystem is quality of community extensions and themes. Cutting of all old and unmaintained extensions may be not that bad... Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Develo

Re: [PHP-DEV] [RFC] Reclassifying engine warnings

2019-09-13 Thread Robert Korulczyk
W dniu 12.09.2019 o 22:45, Rowan Tommins pisze: > On 12/09/2019 15:43, Robert Korulczyk wrote: >> One additional line will make your code much more obvious and easier to read >> and understand: >> >> $i ??= 0; >> $i++; > > > I don't find this code

Re: [PHP-DEV] [RFC] Reclassifying engine warnings

2019-09-12 Thread Robert Korulczyk
learly is important - the less ambiguity the better. Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Deprecate PHP's short open tags, again

2019-08-14 Thread Robert Korulczyk
> Good for you! Come take a stab at my legacy project. It's horrendous. We have > some files where using PhpStorm's automatic formatting actually caused > stuff to break. So, you can see why I might be a little reticent to depend on > an automated tool to change my php tags. I'll let you start

Re: [PHP-DEV] Deprecate PHP's short open tags, again

2019-08-14 Thread Robert Korulczyk
> While possibly a bit hyperbolic, most of the arguments basically come off > that way to me as well. I've definitely viewed most of what you've said in > that manner. I guess we're in some kind of limbo where half of the people do not consider problems which short open tags create as serious,

Re: [PHP-DEV] Deprecate PHP's short open tags, again

2019-08-14 Thread Robert Korulczyk
> This discussion has gone out of sanity levels the moment people started to > state that short tags is one (of the many) > things PHP has why new programmers and companies don't pick the language or > why colleagues laugh at you and is a > blocker of new bright future etc. and now in this

Re: [PHP-DEV] Deprecate PHP's short open tags, again

2019-08-14 Thread Robert Korulczyk
editor which will generate code like `exec($_GET['param'])`, while there is at least one popular IDE which will generate code with short open tags. Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Deprecate PHP's short open tags, again

2019-08-14 Thread Robert Korulczyk
> Sure those are important - I was just pointing out that the "security card" > is questionable since the language has more dangerous features > which ask for the user to be careful and responsible about them rather than > making everything foolproof and accident-free. Honestly, I don't see how

Re: [PHP-DEV] Deprecate PHP's short open tags, again

2019-08-14 Thread Robert Korulczyk
s/features are allowed by default while every other guide on hardening web suggests those to be disabled (added to disable_functions)? These methods have their purpose (pretty important BTW), short open tags is just "don't use it!!!" feature. Regards, Robert Korulczyk -- PHP Internals - PHP

Re: [PHP-DEV] Deprecate PHP's short open tags, again

2019-08-14 Thread Robert Korulczyk
W dniu 14.08.2019 o 11:09, Christian Schneider pisze: > Am 14.08.2019 um 10:39 schrieb Peter Kokot : >>> The best counterargument I can give against "cleaning up" is that it takes >>> energy away from actual new features, even if it's just the mental energy >>> of monitoring and responding to

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

2019-08-09 Thread Robert Korulczyk
fine on one environment and leak on another. Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Bringing Peace to the Galaxy

2019-08-09 Thread Robert Korulczyk
t want to spend money on upgrading them. If BC breaks are really such a big problem for thousands of companies, there should be no problem to find founders to pay ~1 developer for maintaining LTS line and backporting security fixes. Regards, Robert Korulczyk -- PHP Internals - PHP Runtime De

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

2019-08-09 Thread Robert Korulczyk
> I did mention such example with the 'engine' setting ( > https://www.php.net/manual/en/apache.configuration.php#ini.engine as it's > PHP_INI_ALL ). Of course you could ask why would anyone do that (and afaik > it's sapi specific) but technically it can happen just in one "hard to > notice"

Re: [PHP-DEV] Bringing Peace to the Galaxy

2019-08-09 Thread Robert Korulczyk
atures and BC breaks. Regards, Robert Korulczyk -- 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, again

2019-08-09 Thread Robert Korulczyk
haviour? Can you give an example where using `.user.ini` may create unexpected and hard to notice code leaks? Regards, Robert Korulczyk -- 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, again

2019-08-08 Thread Robert Korulczyk
in the foot - it exists, but no one should use it. And it is still really easy to use it by accident. For example, this is what PhpStorm generates when you try to inline-comment tag with short echo: Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe,

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

2019-08-08 Thread Robert Korulczyk
> Many people have talked about the potential impacts of keeping short tags. > I have yet to see anyone give an actual example where they have been > negatively impacted by their existence. I've given you my personal story of > how removing them will negatively impact my company. I welcome anyone

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

2019-08-07 Thread Robert Korulczyk
pop out without any warning and explanation (exception "It's PHP, deal with it"). Regards, Robert Korulczyk -- 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-11 Thread Robert Korulczyk
I'm surprised by the controversy around this change. So far it was an obvious anti-pattern for me, and never seen anybody who was aware of the consequences of using On 4/11/2019 1:12 AM, Robert Korulczyk wrote: >>> Sorry for the sarcasm, please don't consider this as a personal attack. T

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

2019-04-11 Thread Robert Korulczyk
> Sorry for the sarcasm, please don't consider this as a personal attack. The > whole community (not just you) considers short open tags poison because not > XML-compatible... This is rather removing another trap from the language. As long as short open tags exist and depend on INI directive,

Re: [PHP-DEV] Mixed type-hint

2019-02-08 Thread Robert Korulczyk
e rare anyway, but this is just example when mixed type-hint may work as actual type-hint, not just replacement for PHPDoc or equivalent of... nothing. Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Mixed type-hint

2019-02-08 Thread Robert Korulczyk
Sounds like an arbitrary interpretation. Treating `?mixed" as "top type" (including null) would be more practical and consistent with other type-hints. Regards, Robert Korulczyk W dniu 08.02.2019 o 12:47, Marco Pivetta pisze: > `mixed` is the "top" type, which mea

Re: [PHP-DEV] Mixed type-hint

2019-02-08 Thread Robert Korulczyk
What definition? Regards, Robert Korulczyk W dniu 08.02.2019 o 12:37, Marco Pivetta pisze: > Mixed includes null by definition. > > On Fri, 8 Feb 2019, 12:21 Robert Korulczyk <mailto:rob...@korulczyk.pl> wrote: > > > Without this, the mixed type-hint is bas

Re: [PHP-DEV] Mixed type-hint

2019-02-08 Thread Robert Korulczyk
mixed is not very pragmatic - mixed could be used to disallow null, so it will actually work for type check. Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: RFC Weakrefs

2019-02-03 Thread Robert Korulczyk
> I can't really think of another name ... it's ... a weakref ... It is actually "weak reference", so why not WeakReference? Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [VOTE] Typed properties v2

2018-09-23 Thread Robert Korulczyk
typehints or type checks (which you would probably do anyway). And you still can create an uninitialized object for lazy initialization or whatever you want. -- Regards, Robert Korulczyk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php