Re: [PHP-DEV] Allow new Cl()->method()

2020-12-03 Thread Michael Voříšek - ČVUT FEL
ed as (new Cl())->method();, new (Cl()->method()); is very unusual and parenthesis can be always used to enforce the intended precedence. With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL On 3 Dec 2020 07:45, Michał Marcin Brzuchalski wrote: Hi Mi

[PHP-DEV] Allow new Cl()->method()

2020-12-02 Thread Michael Voříšek - ČVUT FEL
w" operator has already the highest precedence, thus there should be no conflict. With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL

[PHP-DEV] DateTimeInterface interface stub has no modify method

2020-12-01 Thread Michael Voříšek - ČVUT FEL
Intentionally? It is an issue for static analysers... With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL

Re: [PHP-DEV] Nightly builds

2020-11-30 Thread Michael Voříšek - ČVUT FEL
with it. Is it ok to introduce "master-passing" branch in official repo, that will be updated at the very end by CI job triggered by push to "master" branch? With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL On 30 Nov 2020 16:07, Nikita

[PHP-DEV] Detect if function is disabled from c ext

2020-11-29 Thread Michael Voříšek - ČVUT FEL
237 | if (func->handler == ZEND_FN(display_disabled_function)) { Thanks for help in advance. With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL

[PHP-DEV] Nightly builds

2020-11-28 Thread Michael Voříšek - ČVUT FEL
uch more sooned until next php minor version has an alpha release. What is your opinion on this and is here someone that can implement it? With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL

Re: [PHP-DEV] [RFC] Draft - Closure self reference

2020-11-11 Thread Michael Voříšek - ČVUT FEL
Hi everyone, maybe a bad idea, but what about addressing the "Principle of least astonishment" issue by allowing to specify/capture the variable after the function is assigned: $f = function () use ($f) {...}; With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael

Re: [PHP-DEV] [RFC] Support for ::function syntax

2020-11-08 Thread Michael Voříšek - ČVUT FEL
Hi, what about resolving directly to Closure? strtoupper::function === \Closure::fromCallable('strtoupper'). $this->method::function === \Closure::fromCallable([$this, 'method']). With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 8 Nov 2020 00:41,

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
4, Michael Voříšek - ČVUT FEL wrote: I agree - "it's harder to imagine a scenario in real life where". [...] If we can agree, that implementation is not guaranteed to be called with named parameters only, what real world usecase to defend this current php behaviour is left? Y

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
n in iface/parent class With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 28 Oct 2020 17:39, Chase Peeler wrote: On Wed, Oct 28, 2020 at 11:15 AM Michael Voříšek - ČVUT FEL wrote: I agree - "it's harder to imagine a scenario in real life wher

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
rüßen / S přátelským pozdravem, Michael Voříšek On 28 Oct 2020 15:57, Rowan Tommins wrote: On 28/10/2020 10:45, Michael Voříšek - ČVUT FEL wrote: https://3v4l.org/X8omS parameters renamed, result with named parameters is different While it's easy to construct an example where this happens, it'

Re: [PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-28 Thread Michael Voříšek - ČVUT FEL
of OOP inheritance at least) With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 26 Oct 2020 15:36, Rowan Tommins wrote: On 26/10/2020 13:12, Michael Voříšek - ČVUT FEL wrote: I am writing regarding bug 80248. Currently, PHP 8 allows parameter reuse

[PHP-DEV] Bug #80248 - Swapping parameter names during inheritance does not throw

2020-10-26 Thread Michael Voříšek - ČVUT FEL
Hi, I am writing regarding bug 80248. Currently, PHP 8 allows parameter reuse at different position, which I belive is very dangerous, as passed parameters may be passed in a different order with different object impl. See https://3v4l.org/X8omS , which is against OOP and LSP. I belive, we

Re: [PHP-DEV] List of attributes

2020-10-23 Thread Michael Voříšek - ČVUT FEL
Wdyt about dedicating "#" char for attributes? We can deprecate comments with "#" in 8.0 or 8.1 and in later version support attributes with "#" single character - without [] brackets, ie. support: #Attribute1 #Attribte2 public function x()... which will be equivalent to: #[

Re: [PHP-DEV] RFC: Support for multi-line arrow functions

2020-10-05 Thread Michael Voříšek - ČVUT FEL
Yes, "use (*)" is perfect! With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 5 Oct 2020 11:57, Andreas Leathley wrote: On 04.10.20 22:08, Rowan Tommins wrote: If we added an opt-in syntax for "capture everything", we might instead write this: $f =

[PHP-DEV] Re: CallbackFilterIterator is leaking memory

2020-10-01 Thread Michael Voříšek - ČVUT FEL
freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL On 23 Sep 2020 11:28, Michael Voříšek - ČVUT FEL wrote: Hi, can someone please verify https://bugs.php.net/bug.php?id=80125 and fix if possible? With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael

[PHP-DEV] CallbackFilterIterator is leaking memory

2020-09-23 Thread Michael Voříšek - ČVUT FEL
Hi, can someone please verify https://bugs.php.net/bug.php?id=80125 and fix if possible? With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek ČVUT FEL

Re: [PHP-DEV] __isset() and null value

2020-09-04 Thread Michael Voříšek - ČVUT FEL
, student On 4 Sep 2020 20:14, David Rodrigues wrote: Maybe you just can implements your own method to check? Like your exists() example. Em sex, 4 de set de 2020 15:08, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> escreveu: Your examples provide code for checking the existance o

Re: [PHP-DEV] __isset() and null value

2020-09-04 Thread Michael Voříšek - ČVUT FEL
not way (provided by php language) to check for existance of magic property. With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 4 Sep 2020 19:23, Marco Pivetta wrote: Heya, On Fri, Sep 4, 2020 at 7:03 PM Michael Voříšek - ČVUT FEL wrote: isset() returns

[PHP-DEV] __isset() and null value

2020-09-04 Thread Michael Voříšek - ČVUT FEL
isset() returns false for null __isset() should return the same, but then if magic property with null value exists, there is no way to detect it Example: https://3v4l.org/GqUsh this is currently an limitation of php Ideally, we should introduce __exist() which should return true even if

Re: [PHP-DEV] Pass source object to clone like __clone($origThis)

2020-09-03 Thread Michael Voříšek - ČVUT FEL
The goal is to be able to access the original object and it's id/hash. Usecases: - something is associated with the object using the object id/hash and it needs to be cloned as well we need the original object to obtain it's id/hash for spl_object_id and spl_object_hash methods -

[PHP-DEV] Pass source object to clone like __clone($origThis)

2020-09-02 Thread Michael Voříšek - ČVUT FEL
Hi, please look at https://stackoverflow.com/questions/63675888/get-original-source-instance-in-clone do you have anything against updating PHP to pass "instance before cloned" to any __clone call from php? no BC - user may accept this extra argument or declare function __clone() without any

Re: [PHP-DEV] Draft RFC: foreach iteration of keys without values

2020-09-02 Thread Michael Voříšek - ČVUT FEL
I like "void", as "null" can be ambiguous. Imagine function example($a = 'default value 1', $b = 'default value 2') {} With "void", we can allow skipping arguments in advance to the default pamameter value like example(void, 'test');. With kind regards / Mit freundlichen Grüßen / S

Re: [PHP-DEV] Request for couple memory optimized array improvements

2020-08-31 Thread Michael Voříšek - ČVUT FEL
PM Michael Voříšek - ČVUT FEL wrote: Optimizing foreach (array_keys($arr) as $k) is very important, not only because of memory, but because of speed when not all elements needs to be iterated, like: foreach (array_keys($arr) as $k) { if ($k some condition) { break; } } Can

Re: [PHP-DEV] Request for couple memory optimized array improvements

2020-08-31 Thread Michael Voříšek - ČVUT FEL
Optimizing foreach (array_keys($arr) as $k) is very important, not only because of memory, but because of speed when not all elements needs to be iterated, like: foreach (array_keys($arr) as $k) { if ($k some condition) { break; } } please, can someone send a PR for this?

[PHP-DEV] Array map with reset function

2020-08-25 Thread Michael Voříšek - ČVUT FEL
The following code stopped working in PHP 8: https://3v4l.org/UlIE3 is it a bug or a feature? is posting issues like this to internals@lists.php.net email prefered over opening bug directly? or is there any special email for it? With kind regards / Mit freundlichen Grüßen / S přátelským

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread Michael Voříšek - ČVUT FEL
/ Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 20 Aug 2020 14:25, G. P. B. wrote: Apologies for the double email, my client did something funcky. On Thu, 20 Aug 2020 at 14:22, G. P. B. wrote: On Thu, 20 Aug 2020 at 14:15, Michael Voříšek - ČVUT FEL wrote: Hi everyone

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread Michael Voříšek - ČVUT FEL
: Den 2020-08-11 kl. 10:53, skrev Rowan Tommins: On Tue, 11 Aug 2020 at 08:31, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: I am the author of https://github.com/php/php-src/pull/5961 , please provide feedback. This idea makes a lot of sense to me as a user (I'll leave co

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-19 Thread Michael Voříšek - ČVUT FEL
Please add discussion about merge conflicts. Any inline grouped attribute syntax needs a manual conflict resolution. With ungrouped syntax, I expect recommended CS to be one attribute per line. If this should be the case also for grouped syntax, then it not +1 character, but +2 new lines

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-17 Thread Michael Voříšek - ČVUT FEL
possibility to keep @@ and add @{} as a second syntax for attributes +1, but I would keep same prefix, ie. @@{} (or @@[]), for both syntaxes, it is much easier for human eyes to search for one thing, also easier for grep With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem,

Re: [PHP-DEV] [Concept] Don't cast keys in array to int

2020-08-16 Thread Michael Voříšek - ČVUT FEL
This seems almost as a bug, strict types should apply also for array key which is currently not the case. https://3v4l.org/epv5s With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 17 Aug 2020 02:56, Josh Bruce wrote: I'm sure this conversation has

Re: [PHP-DEV] Voting access

2020-08-16 Thread Michael Voříšek - ČVUT FEL
, Michael Voříšek - ČVUT FEL wrote: Hello, I am lead developer in Atk4 project, see https://github.com/mvorisek , but you are right, I need to be chosed by someoen with VCS account first. You do not have a VCS account, so you do not qualify for the firstpart,, the second part is existing people

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-16 Thread Michael Voříšek - ČVUT FEL
I have one major issues with the examples. Syntax Side by Side: The properties are annotated (with attributes) inline which is the opposited of common usage now (with annotation). Discussion on Grouping Pro/Cons: But since this depends on the coding style the user... No, this should be

[PHP-DEV] Voting access

2020-08-16 Thread Michael Voříšek - ČVUT FEL
Hello, based on https://wiki.php.net/rfc/voting voting access is offered to people who: - contributed to PHP source - I have made several smaller contributions to php-src incl. + some core xdebug optimization - lead developers of PHP based projects - I contributed to Symfony, Mink and

Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change

2020-08-15 Thread Michael Voříšek - ČVUT FEL
I am for stopping the current voting too - because the results are very different vs. the previous voting, they are almost random and the discussion is still very hot which violates rule when voting can be started. My personal opinion on the attributes is: - allow not grouped syntax (with @@

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Michael Voříšek - ČVUT FEL
Another reason is that sleep(0.1); is silently accepted now (even with strict types enabled), That appears to not be true: https://3v4l.org/7YbqX corrected, should be "without strict types enabled" - https://3v4l.org/A2olN "even with strict type enabled" statement in BC section remains

[PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Michael Voříšek - ČVUT FEL
Hi everyone, I am the author of https://github.com/php/php-src/pull/5961 , please provide feedback. All details should be in the description, also, please advise if we can consider it as a small change not requiring RFC as Nikita proposed in his comment. With kind regards / Mit

[PHP-DEV] Feature request - allow to append multiple elements to an array

2020-03-28 Thread Michael Voříšek - ČVUT FEL
Hi all PHP gurus! This is a feature request / RFC for the following use-case: $res = []; foreach ($arr as $i) { foreach (make_res($i) as $v) { $res[] = $v; } } Array_merge in loop is very sloop so it is not a solution. which I propose to shorten to: $res = []; foreach ($arr as $i) {