Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript

2024-06-29 Thread David Gebler
On Sat, Jun 29, 2024 at 9:27 PM Michael Morris wrote: > > Near universal unity?? You're forgetting Wordpress, which has massive PHP > market share (more than 50% of PHP backed websites - well more than > depending on which survey you cite) and DOES NOT USE COMPOSER. And it DOES > NOT USE PSR-4 e

[PHP-DEV] pcntl_exec update proposal

2024-07-08 Thread David CARLIER
Hi, Through this existing PR , I wanted to know how would appeal to you adding some access restriction upon this existing call, using the open basedir check. So if the sysadmin wants the php user having no business calling `/bin` commands for examples wou

[PHP-DEV] ext/gd adding imagecompare

2024-07-09 Thread David CARLIER
Hi, I plan to add imagecompare to the gd extension . No problem so far however a little discussion of the returned value https://github.com/php/php-src/pull/14877#issuecomment-2217686123 I personally see a value of a bitmask rather than just boolean whi

Re: [PHP-DEV] ext/gd adding imagecompare

2024-07-09 Thread David CARLIER
Hi Saki. On Tue, 9 Jul 2024 at 17:49, Saki Takamachi wrote: > Hi David, > > > Hi, > > > > I plan to add imagecompare to the gd extension. No problem so far > however a little discussion of the returned value > > > > https://github.com/php/php-src/pull/

Re: [PHP-DEV] ext/gd adding imagecompare

2024-07-09 Thread David CARLIER
Hi, On Tue, 9 Jul 2024 at 17:59, Kamil Tekiela wrote: > Boolean is a much more confusing value here. A bit mask is ok, but I would > prefer a better solution. Maybe a simple value object? > That could be an option too sure.

Re: [PHP-DEV] ext/gd adding imagecompare

2024-07-09 Thread David CARLIER
On Tue, 9 Jul 2024 at 18:31, Saki Takamachi wrote: > Hi David, > > It seems to be the opposite regarding his proposition gdImageCompare(im1, > im2) & GD_CMP_IMAGE. Then yes you are right, we are losing the specifics. > If you want to figure out how the image 1 and image 2

Re: [PHP-DEV] ext/gd adding imagecompare

2024-07-10 Thread David CARLIER
Hi On Tue, 9 Jul 2024 at 19:16, Tim Düsterhus wrote: > Hi > > On 7/9/24 19:53, David CARLIER wrote: > > Agreed, I ll likely just commit as is sometime this week. > > I hereby formally claim that this is not a simple self-contained > feature. It does require an RFC. &g

Re: [PHP-DEV] On fixing DOMNameSpaceNode and DOM NS API Inconsistency Problems

2019-03-12 Thread David Zuelke
you can cause prefix collisions. But even that is trivial; internally, the mappings always get optimized, e.g. in the case of duplicate prefixes for the same namespace URI: $doc = new DOMDocument(); $root = new DOMElement("root"); $doc->appendChild($root); $root->setAttributeNS("urn:

Re: [PHP-DEV] [RFC] Arrow functions / short closures

2019-03-13 Thread David Rodrigues
mple is roughly equivalent > to: > > function($x) use($multiplier) { return $x * $multiplier; } > > The RFC contains a detailed discussion of syntax choices and binding modes. > > Regards, > Nikita > -- David Rodrigues

Re: [PHP-DEV] [RFC] Arrow functions / short closures

2019-03-14 Thread David Rodrigues
> So the following, while redundant, is currently valid: > > $foo = [ ($bar) => $baz ]; > Yeah, I don't think in that case. And maybe using [] instead of ()? For instance: "[$x] => $x + 1". PHP don't supports and array as key, so maybe it will not causes any conflict. -- David Rodrigues

[PHP-DEV] PHP_VERSION_SERIES_EOL_DATE or similar constants?

2019-03-18 Thread David Zuelke
ivial? Not? Great? Bad? RFC worthy? Regards, David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Change the precedence of the concatenation operator

2019-03-29 Thread David Rodrigues
is promoting programmers to make mistakes. Albeit typically > easy to catch ones, it is a quality of life change at least. > > Hence I'm proposing a RFC changing the precedences: > https://wiki.php.net/rfc/concatenation_precedence > > Bob > -- David Rodrigues

[PHP-DEV] random_seed()

2019-03-31 Thread David Rodrigues
Just to know, can we have a random_seed() for random_int()/random_bytes() like we have mt_srand() to mt_rand()? I don't know if random_int() is more "random" than mt_rand(), but if it is, so maybe is valid a random_seed() function. -- David Rodrigues

Re: [PHP-DEV] [RFC] Provide argon2 support for password_hash() from ext/sodium

2019-04-05 Thread David Zuelke
You're listing libsodium versions 0.15 and 0.13 there, but it should be 1.0.15 and 1.0.13. Maybe for everyone's reference: Ubuntu 16.04 LTS comes with no libargon2, and with libsodium 1.0.8; 18.04 LTS comes with libargon2 and with libsodium 1.0.16. Debian Stretch has 1.0.11, and 1.0.17 in backpor

Re: [PHP-DEV] [RFC] Nullable Casting

2019-04-07 Thread David Rodrigues
a static factory method that depends of an ?int to be created, and I can't just skip it with an if() if user input is empty. And about "settype($variable, "?int")" it was requested on original mailing by Claude Pache. Em dom, 7 de abr de 2019 às 23:54, Dan Ackroyd escrev

[PHP-DEV] Allow number_format() have three args

2019-04-08 Thread David Rodrigues
f you pretends to keep the comma as fourth arg once that normally you will use or "." or "," as decimal separator. * If you pretends to use dot + comma, just use two args; * If you pretends to use comma + dot, just use four args; * If you pretends to use dot + nothing, use three args; * If you pretends to use comma + nothing, use three args; -- David Rodrigues

[PHP-DEV] Re: [RFC] Nullable Casting

2019-04-21 Thread David Rodrigues
what you got? (It is already supported by PHP): Answer: int (0), int (123) and int (0), respectively. Em dom, 21 de abr de 2019 às 06:19, Guilliam Xavier < guilliam.xav...@gmail.com> escreveu: > On Sat, Apr 6, 2019 at 9:52 AM Guilliam Xavier > wrote: > > > > Hello

[PHP-DEV] TCO: Tail Call Optimization

2019-04-27 Thread David Rodrigues
Not long ago I heard about the Tail Call Optimization from ES6. It seemed obscure to me at first, but once I understood the benefit of having it, it seemed like a good idea of optimization for PHP to avoid recursion problems. Is there any plan to make it possible in the engine? -- David

[PHP-DEV] Symbol implementation

2019-04-27 Thread David Rodrigues
ES6 supports the Symbol type that is a replacement to hard-coded identifiers where it are not really need. I like to suggests a similar feature to PHP. #0: it should be a partial class that could not be instantiated (new symbol should be invalid, like an abstract class). In this point I should s

Re: [PHP-DEV] Memory leak in eval()'d code

2019-06-29 Thread David Walker
On Sat, Jun 29, 2019 at 15:52 Nikita Popov wrote: > On Sat, Jun 29, 2019 at 11:25 PM Benjamin Morel > wrote: > > The leaked memory is an allocated but unused class > entry. We could plug that particular leak -- but I should emphasize that > the current behavior is incorrect and once the key col

Re: [PHP-DEV] PHP 7.4.0RC3 is available for testing

2019-10-03 Thread David Rodrigues
9AGId2Gp0YgGOaNTu+BZmeB6Q+pnjWNO5fJVRry68= > =ueur > -END PGP SIGNATURE- > > > -- > PHP 7.4 Release Manager > Host of PHP Internals News: https://phpinternals.news > Like Xdebug? Become my Patron: https://www.patreon.com/derickr > https://derickrethans.nl | https://xdebug.org | https://dram.io > twitter: @derickr and @xdebug > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- David Rodrigues

[PHP-DEV] Inline switch as alternative to nested inline conditional

2019-10-15 Thread David Rodrigues
: ( $expr == B1 ? B2 : C ); Just a discussion to check what do you think. -- David Rodrigues

[PHP-DEV] Reclassifying some PHP functions warning as exceptions

2019-10-21 Thread David Negrier
the nature of the exception (what class, what class hierarchy...) My questions: 1- Do you think there is a chance an RFC on this topic might be accepted? Shall I start working on it? 2- Shall we start working on a list of candidate functions? David

[PHP-DEV] VCS Account Request: dasl

2019-11-19 Thread David Leibovic
Developing the PHP runtime -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] register_shutdown_function() not supports private methods

2019-11-27 Thread David Rodrigues
t a public scope. As workaround I am keeping it as public. So, there are some reason to it do not works like spl does? -- David Rodrigues

Re: [PHP-DEV] register_shutdown_function() not supports private methods

2019-11-28 Thread David Rodrigues
Em qui., 28 de nov. de 2019 às 14:13, Dan Ackroyd escreveu: > On Wed, 27 Nov 2019 at 23:33, David Rodrigues > wrote: > > > > Hi internals, > > > > I am using the register_shutdown_function() inside a class, and then I > have > > created a private meth

Re: [PHP-DEV] Operator overloading for userspace objects

2020-01-28 Thread David Rodrigues
have an error. Call order should be respected now once that will be impossible you have $objectA * $objectB without defines a priority (the main handler). -- Atenciosamente, David Rodrigues Em ter., 28 de jan. de 2020 às 20:14, escreveu: > Hello everybody, > > > > the last days I

Re: [PHP-DEV] New PCRE function

2020-02-19 Thread David Rodrigues
Maybe you can set all this messages as lowercase? That way we can use it more easily. If we need the first letter in capital letters we can use `ucfirst()`, because the opposite is more complicated (a `strtolower()` would "break" the "JIT" message, for example). Atenciosame

Re: [PHP-DEV] Re: [RFC] Attributes v2

2020-03-09 Thread David Rodrigues
ntil the PSR staff decides how best to write. Atenciosamente, David Rodrigues Em seg., 9 de mar. de 2020 às 16:19, Andrea Faulds escreveu: > Benjamin Eberlei wrote: > > I want to resurrect Dmitrys Attributes RFC that was rejected for 7.1 in > > 2016 with a few changes, incorporating feed

Re: [PHP-DEV] [RFC] Attributes v2

2020-03-09 Thread David Rodrigues
ther languages. And too, could annotators have some additional features like Typescript decorators? Atenciosamente, David Rodrigues Em seg., 9 de mar. de 2020 às 16:35, Aleksander Machniak escreveu: > On 09.03.2020 15:42, Benjamin Eberlei wrote: > > The RFC is at https://wiki.php.net/r

[PHP-DEV] Argument with default value

2020-03-14 Thread David Rodrigues
int $b = 0) My suggestion would be to use the keyword "default" in the context of the argument. To avoid confusion, another keyword could be created, but I don't see why they confuse "default" as an argument and "default" for switch. test(default, 2) === test(M_PI, 2, 0) Atenciosamente, David Rodrigues

[PHP-DEV] Class cast

2020-03-25 Thread David Rodrigues
and properties. --- To make possible custom some kind of castings, I suggests a new magic method __cast($value). class Number { ... function __cast($value) { if (is_int($value) || is_float($value)) return new static($value); throw new TypeError(); } } Just to talk. Atenci

Re: [PHP-DEV] Class cast

2020-03-25 Thread David Rodrigues
); But you have only A $a. You can create: function __cast($value) { if ($value instanceof A) return B($value, 123, M_PI); } Then use: requiresB((B) $a); Atenciosamente, David Rodrigues Em qua., 25 de mar. de 2020 às 20:06, Stanislav Malyshev < smalys...@gmail.com> escreveu: >

Re: [PHP-DEV] [RFC] Constructor Property Promotion

2020-03-26 Thread David Rodrigues
ction __construct(public int $x) { ... } } class B extends A { public function __construct(public int $y) { ...; parent::__construct($y); } } Atenciosamente, David Rodrigues Em qui., 26 de mar. de 2020 às 12:45, Sebastian Bergmann escreveu: > Am 26.03.2020 um 14:30 schrieb Nikita Popo

Re: [PHP-DEV] semicolon terminator for switch cases

2020-03-26 Thread David Rodrigues
I agree with Tovilo. It is weird and confusing. Actually I never know that it was possible. And the ";" sounds like "it ends here", while ":" counds like "it does it ->". For me, "case 1;" will sounds like "skip case 1". Atencio

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

2020-03-28 Thread David Rodrigues
I think it useful, despite that it could be done by using array_push() as Woortmann said. Anyway, I think valid a new proposal for thinks like that. But I will suggests this: $arr[] = ... $items; Atenciosamente, David Rodrigues Em sáb., 28 de mar. de 2020 às 20:07, Michael Voříšek - ČVUT FEL

Re: [PHP-DEV] [RFC][POLL] Switch expression

2020-03-31 Thread David Rodrigues
another format to switch. And maybe you should just use "return" here to specify the return value. $x = switch ($y) { case 1: return $y + 1; case 2: return $y - 1; // default: return null; }; Atenciosamente, David Rodrigues Em ter., 31 de mar. de 2020 às 15:51, Ilija Tovilo

Re: [PHP-DEV] [DISCUSSION] Match expression

2020-04-13 Thread David Rodrigues
ch are basically the same thing, however, in different scopes. Likewise, "break 2" would be impossible in this case, so just issue an error saying "break n is not supported in this situation". Atenciosamente, David Rodrigues Em seg., 13 de abr. de 2020 às 11:49, Rowan Tommins e

Re: [PHP-DEV] [DISCUSSION] Match expression

2020-04-13 Thread David Rodrigues
But when we do: function x() { $a = function () { return 123; } } We know that "return" here is for the current function () scope, and not for the parents one. So "return" inside inlined-switch should be used to specify the switch return itself. Seems clear to me. A

Re: [PHP-DEV] max_input_vars trigger detection

2020-05-10 Thread David Rodrigues
Maybe throw an exception by default when it happen. Considering max_input_vars+1, when hit, throw. Em dom, 10 de mai de 2020 09:34, Craig Duncan escreveu: > > > > Although not particularly elegant, and it does require you to reject > requests that hit but don't exceed the limit, I've used this a

Re: [PHP-DEV] Proposal For Return-If / Early Return / Guard Clause Syntax

2020-05-10 Thread David Rodrigues
Suggestion: return if $x > 1; (to return "void") return $y if ($x > 1 && $x < 5); break if $x > 1; break 2 if $x > 1; throw new Exception if $x > 1; Em dom, 10 de mai de 2020 15:48, Nikita Popov escreveu: > On Sun, May 10, 2020 at 5:49 PM Ralph Schindler > wrote: > > > Hi! > > > > > > # Intr

Re: [PHP-DEV] Proposal For Return-If / Early Return / Guard Clause Syntax

2020-05-10 Thread David Rodrigues
I just think that this way is more compatible witth the reading. "Return X if Y" seems better than "return (if) X: (then) Y". Too the ":" could conflicts with return type. Em dom, 10 de mai de 2020 16:59, Ralph Schindler escreveu: > > > On 5/10/20 1:56 PM

[PHP-DEV] Graceful timeout

2020-05-16 Thread David Rodrigues
need works with external resources, like RESTful, where timeout can occur and we need a better way to work with that. Or when we have few seconds to run a process. What do you think? Atenciosamente, David Rodrigues

[PHP-DEV] Improvement to errors

2020-05-26 Thread David Rodrigues
t; I believe that the second solution is the simplest to be implemented and already solves the problem enough. Atenciosamente, David Rodrigues

[PHP-DEV] RFC proposal: fsync support for file resources

2020-06-01 Thread David Gebler
Exactly as the subject says, I would like to propose an RFC for adding an fsync() function for file resources, which would in essence be a thin wrapper around C's fsync on UNIX systems and _commit on Windows. It seems to me an odd oversight that this has never been implemented in PHP and means PHP

Re: [PHP-DEV] RFC proposal: fsync support for file resources

2020-06-01 Thread David Gebler
No, fflush will flush the PHP application buffers out to the operating system, it does in contrast to fsync not provide a guarantee the operating system will immediately persist to the underlying storage device. On Mon, 1 Jun 2020, 18:49 Dennis Birkholz, wrote: > Hello David, > > isn

Re: [PHP-DEV] RFC proposal: fsync support for file resources

2020-06-01 Thread David Gebler
buffers to the operating system *and tell the operating system to immediately flush its buffer to disk too*", so when this function returns success status you can be as reliably sure as possible that data has been physically persisted. fflush does not provide this assurance. On Mon, 1 Jun 2020

Re: [PHP-DEV] RFC proposal: fsync support for file resources

2020-06-01 Thread David Gebler
ther that big is the effort required to implement this feature. On Mon, Jun 1, 2020 at 8:47 PM Christian Schneider wrote: > Am 01.06.2020 um 18:56 schrieb David Gebler : > > It seems to me an odd oversight that this has never been implemented in > PHP > > and means PHP has no wa

Re: [PHP-DEV] RFC proposal: fsync support for file resources

2020-06-04 Thread David Gebler
ailable on Windows, but fsync() is. fdatasync() is available on UNIX builds. fdatasync() on Windows is an alias of fsync(), on UNIX fdatasync() is as expected. Only fsync() is implemented for both Windows and Unix. -Dave On Wed, 3 Jun 2020, 11:16 Nikita Popov, wrote: > On Mon, Jun 1, 2020 at

Re: [PHP-DEV] RFC proposal: fsync support for file resources

2020-06-05 Thread David Gebler
As a side-note, I am unable to register a wiki.php.net account to raise this RFC, I get a very unhelpful error message which just says "That wasn't the answer we were expecting" when I submit my details. Anyone have any idea what that is? On Thu, Jun 4, 2020 at 3:19 PM Davi

Re: [PHP-DEV] RFC proposal: fsync support for file resources

2020-06-05 Thread David Gebler
Thanks, my browser was automatically populating the wrong email, I've now registered. Apparently I need to request karma now? Username dwgebler. On Sat, Jun 6, 2020 at 12:19 AM Christoph M. Becker wrote: > On 06.06.2020 at 00:00, David Gebler wrote: > > > As a side-note, I am u

Re: [PHP-DEV] About the use of the terms master/slave and blacklist, proposal to replace.

2020-06-15 Thread David Rodrigues
life (of course, considering that there are really exceptions). Anyway, I believe that we must keep the current terminology as long as it has specific meaning for us and, if it is to change, to change little by little, and not in a radical or forced way. Atenciosamente, David Rodrigues Em seg.,

Re: [PHP-DEV] Re: [VOTE] Attribute Amendments

2020-06-22 Thread David Rodrigues
I like to suggest that, by default, attributes could be repeatable, so we can disable this instead (eg. "@@ Attribute(self::IS_UNIQUE)"). Atenciosamente, David Rodrigues Em seg., 22 de jun. de 2020 às 13:38, Benjamin Eberlei escreveu: > Hello, > > The voting period is over

Re: [PHP-DEV] [RFC] Property write visibility

2020-06-29 Thread David Rodrigues
, because if we have get:public, and $x is accessible, so it is isset by nature. Atenciosamente, David Rodrigues Em seg., 29 de jun. de 2020 às 12:03, Deleu escreveu: > As a user, I would prefer the original proposed syntax `public:private` or > the Swift syntax `public private(set)` t

[PHP-DEV] Improve "trying to get property 'id' of non-object" error message

2020-07-02 Thread David Rodrigues
;property -> trying to get property 'id' of non-object (array) retrieved from return of getObject() Atenciosamente, David Rodrigues

Re: [PHP-DEV] Improve "trying to get property 'id' of non-object" error message

2020-07-02 Thread David Rodrigues
Seems great, but maybe include more information should be better: Warning: Attempt to read property 'property' on bool <> in /in/IGUcS on line 5 Atenciosamente, David Rodrigues Em qui., 2 de jul. de 2020 às 12:27, Máté Kocsis escreveu: > Hi David, > > Please have a

Re: [PHP-DEV] [RFC] \PHP namespace usage heuristics

2020-07-07 Thread David Rodrigues
There are some problem by using double back slash for PHP namespace? Eg. Instead of \PHP\String be just \\String. Em ter, 7 de jul de 2020 19:04, Larry Garfield escreveu: > On Tue, Jul 7, 2020, at 4:22 PM, Miguel Rosales wrote: > > Larry Garfield wrote on 07/07/2020 16:46: > > > This has reache

Re: [PHP-DEV] [RFC][Discussion] Objects can be declared falsifiable

2020-07-15 Thread David Rodrigues
cast working together with __toBool() is a good one, but I think that it is being discussed in another topic. Atenciosamente, David Rodrigues Em ter., 14 de jul. de 2020 às 20:59, Josh Bruce escreveu: > Implement an interface and magic method to allow objects to represent > false (or empty) w

Re: [PHP-DEV] The @@ is terrible, are we sure we're OK with it?

2020-07-22 Thread David Rodrigues
ribute(...), ... Or even create a new keyword like: with Attribute(...), ... function withAttribute() { ... } And in last case, just use nothing but the attribute itself as a prefix: Attribute(...) function withAttribute() {...} Atenciosamente, David Rodrigues Em qua., 22 de jul. de 2020 às

Re: [PHP-DEV] The @@ is terrible, are we sure we're OK with it?

2020-07-23 Thread David Rodrigues
eed a new keyword, so we can apply it "as a function": attr(Attribute(), Attribute()) function () {...} or attribute(). Or even more complex syntaxes, like: [: Attribute :]. Atenciosamente, David Rodrigues Em qui., 23 de jul. de 2020 às 12:32, Benas IML escreveu: > Just to chime i

[PHP-DEV] Allow two words keywords

2020-07-29 Thread David Rodrigues
le is very hard to Google symbols (so search will be "what mean double at in PHP" or "what mean hashtag brackets"). Atenciosamente, David Rodrigues

Re: [PHP-DEV] Allow two words keywords

2020-07-29 Thread David Rodrigues
Oh, you are right! "yield from" is not common for me currently, so I really skipped it. In this case, is there some problem to apply it to Attribute case? "using attribute(Attribute())" or something like that? Atenciosamente, David Rodrigues Em qua., 29 de jul. de 2020 às

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

2020-07-30 Thread David Rodrigues
I would like to suggests the syntax "using attribute(Attribute, ...)". It is more clear and should not create BC. Em qui, 30 de jul de 2020 10:28, Joe Ferguson escreveu: > On Thu, Jul 30, 2020 at 7:50 AM Benjamin Eberlei > wrote: > > > I think it has become clear that we need to revisit this sy

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

2020-07-30 Thread David Rodrigues
gement, and on future we could have the "verbose syntax" ("using attribute()") and shortened syntax (to be decided, but like "#[...]"). Atenciosamente, David Rodrigues Em qui., 30 de jul. de 2020 às 11:09, tyson andre escreveu: > Hi David, > > > I

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

2020-08-04 Thread David Rodrigues
equired characters: (16+1) - Has end delimiter: yes - Allow grouping: yes - Forward compatibility in PHP 7: yes - Breaks BC of valid PHP 7 codes: no - Used by other languages: no? - Familiar with Docblock Usage: I don't know - Difficulties with Userland Parsers: I don't know Atenciosament

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

2020-08-05 Thread David Rodrigues
A new suggestion: @attr(...). It could be used on future for other syntaxes and should be supersedes the error supression. So will be a BC exclusively for @attr() error supression for attr() function. But it is few verbose and easy to understand. With error supression remotion (9.0?) it could be us

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread David Rodrigues
I suggests to make something like Node does: import "file.php" ($a, $b) so $a and $b must be extracted from file.php context. All other variables should be ignored. Or, to avoid create more complexity and possible new keywords to import syntax, maybe create a new function: importx(string $file, ?

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

2020-08-18 Thread David Rodrigues
I really found your idea better than all. Keywork is already reserved, make sense on this context. Em ter, 18 de ago de 2020 03:49, Aleksander Machniak escreveu: > On 18.08.2020 00:35, Mike Schinkel wrote: > > 1. Postpone inclusion of attributes until PHP 8.1 > > +1 > > I wonder why my suggestio

Re: [PHP-DEV] Re: Should hash comments be deprecated?

2020-08-29 Thread David Rodrigues
I have suggested on past a declare() to help in cases like that: declare(php_version = "8.0"); It could be declared to new PHP files, so old files could supports # as comments and new files will not. Other option is supports escreveu: > Hi internals, > > If it turns out that the impact on lega

[PHP-DEV] array_reject() as counterpart of array_filter()

2020-08-30 Thread David Rodrigues
Currently we have array_filter(), but sometimes we need an inverse function like array_reject(). array_reject('is_null', [ 1, 2, null, 3 ]); // [ 1, 2, 3 ] It could be easily implemented with: function array_reverse($fn, $arr) { return array_filter(fn($item) => !$fn($item), $arr); } Anyway, I t

Re: [PHP-DEV] array_reject() as counterpart of array_filter()

2020-08-31 Thread David Rodrigues
will be very simple and will not need to create a new function to userland. PS.: the array_reject() name suggestion is based on the lodash version ( https://lodash.com/docs/4.17.15#reject). Atenciosamente, David Rodrigues Em seg., 31 de ago. de 2020 às 11:08, Chase Peeler

Re: [PHP-DEV] array_reject() as counterpart of array_filter()

2020-08-31 Thread David Rodrigues
be a good solution, but how hard should it be to create a proxy like that? Atenciosamente, David Rodrigues Em seg., 31 de ago. de 2020 às 11:55, Sara Golemon escreveu: > On Mon, Aug 31, 2020 at 9:41 AM David Rodrigues > wrote: > >> > I agree with Larry that userland implementat

Re: [PHP-DEV] array_reject() as counterpart of array_filter()

2020-08-31 Thread David Rodrigues
tenciosamente, David Rodrigues Em seg., 31 de ago. de 2020 às 13:00, Sara Golemon escreveu: > On Mon, Aug 31, 2020 at 10:35 AM David Rodrigues > wrote: > >> It should be possible for the engine (at some layer) to look at that > closure > >> and see that it's just ne

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

2020-09-02 Thread David Rodrigues
I think "void" is a good solution and is very clear, compared to "_". [void, void, $username] = getUserData(); Atenciosamente, David Rodrigues Em qua., 2 de set. de 2020 às 10:57, Dik Takken escreveu: > On 02-09-2020 15:35, Chase Peeler wrote: > > Isn't t

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

2020-09-02 Thread David Rodrigues
I understand... seems that `$this` is very confusing inside `__clone()`: when writing, it writes to the clone, when reading it reads from original. Seems valid a new optional parameter definition with the original source. Atenciosamente, David Rodrigues Em qua., 2 de set. de 2020 às 15:41

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

2020-09-03 Thread David Rodrigues
I don't see problem to allow modify the original object, once that you are doing it by using a new argument, and not the $this itself. Em qui, 3 de set de 2020 08:49, Pedro Magalhães escreveu: > On Wed, Sep 2, 2020 at 7:41 PM Michael Voříšek - ČVUT FEL < > voris...@fel.cvut.cz> wrote: > > > do y

Re: [PHP-DEV] [RFC] Global functions any() and all() on iterables

2020-09-03 Thread David Rodrigues
Do you think that it could be proxied too? I mean, optimize foreach (array_keys()...) syntax to not call array_keys() in fact, but a optimized version of foreach to handle key only. Em qui, 3 de set de 2020 11:36, Sara Golemon escreveu: > On Mon, Aug 31, 2020 at 6:56 PM tyson andre > wrote: > >

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

2020-09-03 Thread David Rodrigues
Do you think that it could be proxied? I mean, optimize foreach (array_keys()...) syntax to not call array_keys() in fact, but a optimized version of foreach to handle key only. I don't know it opcache could do that, and if it already does. Em qui, 3 de set de 2020 12:12, Levi Morrison via interna

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

2020-09-03 Thread David Rodrigues
$this->copies[] = $userCopy; return $userCopy; } Considering it, we have access to both now, with "write to source" support with no additional feature need. Em qui, 3 de set de 2020 11:21, Sara Golemon escreveu: > On Wed, Sep 2, 2020 at 2:11 PM David Rodrigues > wrote: &g

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

2020-09-03 Thread David Rodrigues
It was just an example to avoid modify how clone works, using existing features. :) Em qui, 3 de set de 2020 13:00, Sara Golemon escreveu: > On Thu, Sep 3, 2020 at 10:40 AM David Rodrigues > wrote: > >> Now I rethinked about what I said. Really, maybe clone is not the best >

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

2020-09-03 Thread David Rodrigues
s created using reflection without > constructor. > > With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, > > Michael Voříšek > > On 3 Sep 2020 18:00, Sara Golemon wrote: > > > On Thu, Sep 3, 2020 at 10:40 AM David Rodrigues > > wrote: >

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

2020-09-04 Thread David Rodrigues
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 of real > properties. But how to check existance of a magic one?

Re: [PHP-DEV] RFC: execution opcode file without php source code file

2020-10-02 Thread David Rodrigues
be done. So opcode could be generated based on encrypted phar to give more speed. Atenciosamente, David Rodrigues Em sex., 2 de out. de 2020 às 13:52, Rowan Tommins escreveu: > On Thu, 1 Oct 2020 at 16:13, Dik Takken wrote: > > > The only use case I see is to package commercial c

[PHP-DEV] static vars must allow expressions

2020-10-05 Thread David Rodrigues
lass Test { public function test(): void { static $x = 0; $x++; var_dump($x); } } (new Test)->test(); // 1 (new Test)->test(); // 2 Note that $x will share the context like a static property, even if it been called from a non-static context. Atenciosamente, David Rodrigues

Re: [PHP-DEV] [RFC] Short-function syntax

2020-10-26 Thread David Rodrigues
x(): void => y(); // equivalents to function x(): void { y(); } Atenciosamente, David Rodrigues Em seg., 26 de out. de 2020 às 11:23, Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> escreveu: > Hi Larry, > > I'm wondering why we hadn't thought yet about r

[PHP-DEV] Supports to ?:= assignment operator

2020-11-11 Thread David Rodrigues
! Atenciosamente, David Rodrigues

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

2020-11-11 Thread David Rodrigues
too. function fn1() as $lambda1 { return function() as $lambda2 use ($lambda1) { return [ gettype($lambda1), gettype($lambda2) ]; }; } Atenciosamente, David Rodrigues Em qua., 11 de nov. de 2020 às 14:59, Christoph M. Becker escreveu: > On 11.11.2020 at 18:39, Dan Ackr

[PHP-DEV] strict_types will be default at some moment?

2020-11-11 Thread David Rodrigues
, the unique behavior). Atenciosamente, David Rodrigues

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

2020-11-20 Thread David Rodrigues
exposes fb() to global scope and could causes errors: function test() { function fb($n): int { if ($n === 0) return 0; if ($n === 1) return 1; return fb($n - 1) + fb($n - 2); } var_dump(fb(10)); } test(); test(); // Fatal error: Cannot redeclare fb() Atenciosamente, David R

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

2020-11-20 Thread David Rodrigues
the stables, so it's too late to enforce the right (to me) ordering. Yeah, but is there any way to go back now? :/ Atenciosamente, David Rodrigues Em sex., 20 de nov. de 2020 às 16:08, Sara Golemon escreveu: > On Fri, Nov 20, 2020 at 12:58 PM Guilliam Xavier < > guilliam.xav...@gm

[PHP-DEV] Method parameter promotion support

2020-11-26 Thread David Rodrigues
red. public function setAge(private int $age) {} Just to think about whether it is possible to think of something along these lines, but I'm still not sure if it's a good option. Atenciosamente, David Rodrigues

[PHP-DEV] Strict switch

2020-11-26 Thread David Rodrigues
itch(8.0) { case strict 8.0: ... } // yes Or allowing operators (this would be the most flexible way, as it would allow for a number of other features): (6) switch(8.0) { case === 8.0: ... } // yes Atenciosamente, David Rodrigues

[PHP-DEV] Traits "implements" support

2020-11-26 Thread David Rodrigues
red! } Atenciosamente, David Rodrigues

[PHP-DEV] PHP.net is down?

2021-01-07 Thread David Rodrigues
Hello! I cannot access php.net anymore. error 500. Atenciosamente, David Rodrigues

[PHP-DEV] [RFC]: fsync function

2021-01-29 Thread David Gebler
to standard, as well as tests and documentation) which I would like to open up for review and discussion. Thanks. David Gebler davidgeb...@gmail.com

[PHP-DEV] Re: [RFC]: fsync function

2021-01-30 Thread David Gebler
Updated the PR https://github.com/php/php-src/pull/6650 following comment from Nikita, added basic tests, would appreciate further review from contributors, have updated the RFC https://wiki.php.net/rfc/fsync_function to under discussion, cheers. David Gebler davidgeb...@gmail.com On Sat, Jan

[PHP-DEV] Re: [RFC]: fsync function

2021-02-01 Thread David Gebler
ering if anyone can shed any light on this? I'm seeing it on some other open PRs too so I'm guessing it's a known issue? Cheers. David Gebler davidgeb...@gmail.com On Sat, Jan 30, 2021 at 6:34 PM David Gebler wrote: > Updated the PR https://github.com/php/php-src/pull/6650 f

Re: [PHP-DEV] Re: [RFC] Enumerations, Round 2

2021-02-01 Thread David Gebler
> We tried that. The `enum` keyword precludes any class or interface being called `Enum`, even internally. Enumerable, Enumerated, Enumerator? On Mon, Feb 1, 2021 at 7:30 PM Larry Garfield wrote: > On Mon, Feb 1, 2021, at 11:48 AM, Alexandru Pătrănescu wrote: > > > > > https://wiki.php.net/rfc

[PHP-DEV] Re: [RFC]: fsync function

2021-02-03 Thread David Gebler
2021 at 5:35 PM David Gebler wrote: > Hi internals, > I have updated the GitHub PR and wiki RFC to also include an > implementation of fdatasync. > > On another note, I note my PR builds are failing on MACOS_DEBUG_NTS with a > test in ext/zend_test/tests/observer_error_05.php

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-04 Thread David Gebler
If this were to be done, my gut feeling is a notice would be preferable to a warning, particularly as there must be many scripts which would suddenly start churning out warnings for this proposed change which might/probably ignore lower error levels and emitting a warning for a previously common sc

<    4   5   6   7   8   9   10   11   12   13   >