Re: [PHP-DEV] RFC: short and inner classes

2025-03-25 Thread Peter Stalman
Why not just add structs at this point? It's almost like we don't want to acknowledge that structs are a thing.

[PHP-DEV] Re: [PHP-DEV] Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4 — Use a carrot, not a stick.

2024-07-27 Thread Peter Stalman
On Fri, Jul 26, 2024 at 6:14 PM Mike Schinkel wrote: > Frankly, if the pro-deprecation voters in the PHP community are not > willing to pursue an initiative that proactively seeks to help users > remediate and educate users about security concerns then I would argue > *they* do not really care ab

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-27 Thread Peter Stalman
On Fri, Jul 26, 2024, 04:58 Tim Düsterhus wrote: > > I just Googled "PHP tutorial" and found https://www.phptutorial.net/ as > the second search result, which considers itself to be "the modern PHP > tutorial". > > I've clicked at the CSRF section > (https://www.phptutorial.net/php-tutorial/php-c

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-26 Thread Peter Stalman
On Thu, Jul 25, 2024 at 11:35 PM Peter Stalman wrote: > If their learning insticast > *instincts. I should also clarify, I'm not against deprecations in general. However, the benefits should outweigh the costs. If something is getting unmaintainable, no longer supported, inherent

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-25 Thread Peter Stalman
On Thu, Jul 25, 2024 at 8:33 AM Tim Düsterhus wrote: > No, we are talking about end users who are following tutorials that were > written when PHP 4 was the most recent PHP version. > > We are also talking about end users who look at existing code bases for > "inspiration", see md5() used, notice

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-24 Thread Peter Stalman
On Wed, Jul 24, 2024 at 3:03 PM Morgan wrote: > And they would still be available as hash("md5") and hash("sha1"); the > only reason they're called out as their own distinct functions today is > historical inertia. > Yes, I am aware of that, it's covered in the RFC and has been discussed. My iss

Re: [PHP-DEV] tsrm question

2024-07-24 Thread Peter Stalman
On Wed, Jul 24, 2024 at 1:15 AM Rob Landers wrote: > Hello internals, > > Last night I went down a rabbit hole with Frankenphp: > https://github.com/dunglas/frankenphp/pull/933 > > It isn't 100% clear to me what values `ts_resource(id)` holds and if it > needs to be freed/allocated per request or

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-23 Thread Peter Stalman
On Mon, Jul 22, 2024 at 9:06 AM Derick Rethans wrote: > - Deprecate md5(), sha1(), md5_file(), and sha1_file() (just says "large > impact") About 1.2 million. https://github.com/search?q=%28md5+OR+md5_file+OR+sha1+OR+sha1_file%29+language%3APHP+&type=code The proposed deprecation of these fu

[PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-19 Thread Peter Stalman
Hi Internals, Obviously we can't use constants or functions directly in strings using variable parsing, I assume because it lacks the easily detectable $. However, we _can_ use methods because the object variable has the $, which I assume is the reason methods work and functions don't. I feel li

Re: [PHP-DEV] [VOTE] noreturn type

2021-03-30 Thread Peter Stalman
Aw, my `terminus` suggestion didn't make it. ☹️ Thanks, Peter

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and short functions take 2

2021-03-24 Thread Peter Stalman
On Wed, Mar 24, 2021 at 10:15 AM Chase Peeler wrote: > I guess my one question would be why we didn't support auto-capture when we > first implemented anonymous functions, and if there was a reason, why does > that no longer apply? > I believe this was the original discussion: https://externals

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-24 Thread Peter Stalman
On Wed, Mar 24, 2021 at 2:26 PM Mark Randall wrote: > To give my own example, earlier this week I wrote the following: > > $x = function () use ($to, $library, $thread, $author, $title, > $library_name, $top_post) { ... } > > That was just to get those variables inside a callback that could be >

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and short functions take 2

2021-03-24 Thread Peter Stalman
On Wed, Mar 24, 2021 at 9:20 AM Larry Garfield wrote: > 1) The updated short-functions RFC: > https://wiki.php.net/rfc/short-functions > > 2) A new RFC, code by Nuno, for auto-capturing multi-statement closures: > https://wiki.php.net/rfc/auto-capture-closure > > These are separate RFCs and at th

Re: [PHP-DEV] [RFC] Short functions, take 2

2021-03-24 Thread Peter Stalman
On Wed, Mar 24, 2021 at 5:40 PM Larry Garfield wrote: > In response to the feedback that the savings in typing volume is small, > that's true but also not the main point. The main point is to allow and > encourage functions to be written an in "expression style", that is, as > actual functions a

Re: [PHP-DEV] [VOTE] Fibers

2021-03-17 Thread Peter Stalman
On Wed, Mar 17, 2021 at 7:41 AM Josh Di Fabio wrote: > Note the difference between the two. Also note how, in both of the > above cases, the asynchronicity is explicit and the developer has > opted into it. Both of the above are different approaches to that > being proposed in this RFC (this is a

Re: [PHP-DEV] [VOTE] Fibers

2021-03-17 Thread Peter Stalman
On Tue., Mar. 16, 2021, 23:49 Josh Di Fabio, wrote: > Imagine for a moment that you create a library, awesome-library-x, > which uses a PSR logger internally. You will most certainly allow that > logger to be injected into your library. Now imagine that some other > developer uses awesome-library

Re: [PHP-DEV] [VOTE] Fibers

2021-03-16 Thread Peter Stalman
On Tue., Mar. 16, 2021, 13:58 Josh Di Fabio, wrote: > Fibers will not make those issues obvious at all. The issues I'm > describing will only crop up spontaneously and under load. > Hi Josh, Is this really that big of a concern though? The issue will only be a problem if it's run inside an eve

Re: [PHP-DEV] Built-in decorator attribute?

2021-03-14 Thread Peter Stalman
On Sun, Mar 14, 2021 at 6:34 PM Peter Stalman wrote: > Would it make sense to have both options? > 6) Multiple decorators on the same function? One problem with the wrapper pattern is that if you have multiple decorators then wouldn't that end up calling the function multiple times?

Re: [PHP-DEV] Built-in decorator attribute?

2021-03-14 Thread Peter Stalman
On Sun, Mar 14, 2021 at 5:34 AM David Gebler wrote: > Before and after hooks are a similar but slightly different implementation, > semantically, to what I was originally suggesting but may be the preferred > option. I think to be useful, you probably still need some way to choose > not to call t

Re: [PHP-DEV] Built-in decorator attribute?

2021-03-14 Thread Peter Stalman
ky framework which could be > easily replaced by a Decorator attribute for the purposes of cross-cutting > changes to function behaviour. > > Regards, > David > > On Sat, Mar 13, 2021 at 10:51 PM Peter Stalman wrote: > > > Hi David, > > > > This sounds a

Re: [PHP-DEV] Built-in decorator attribute?

2021-03-13 Thread Peter Stalman
Hi David, This sounds a lot like Asect Oriented Programming. Have you looked into that? PHP framework: https://github.com/goaop/framework PECL extension: https://aop-php.github.io/ Thanks, Peter On Sat., Mar. 13, 2021, 08:51 David Gebler, wrote: > With the introduction of attributes in PH

Re: [PHP-DEV] [RFC] noreturn type

2021-03-10 Thread Peter Stalman
On Wed., Mar. 10, 2021, 22:59 Sebastian Bergmann, wrote: > Am 11.03.2021 um 07:51 schrieb Peter Stalman: > > I like this RFC, but I'd like to see the RFC cover if any other languages > > have a similar return type. > > The RFC has a "Prior art in other interprete

Re: [PHP-DEV] [RFC] noreturn type

2021-03-10 Thread Peter Stalman
On Wed., Mar. 10, 2021, 11:22 Matthew Brown, wrote: > If a significant number agree I can add a secondary vote on noreturn vs > never, but never introduces more of a BC risk. > Hi Matt, I like this RFC, but I'd like to see the RFC cover if any other languages have a similar return type. The de

Re: [PHP-DEV] [VOTE] Fibers

2021-03-10 Thread Peter Stalman
On Wed., Mar. 10, 2021, 02:16 韩天峰, wrote: > I am afraid that fiber can only be used in the amphp framework and is of > no value to other php projects. > Hi, I'd like to see you elaborate on this point. Are you able to provide anything to back up this claim? I don't see anything that is specif

Re: [PHP-DEV] [VOTE] Fibers

2021-03-10 Thread Peter Stalman
On Tue, Mar 9, 2021 at 6:03 PM twosee wrote: > > 5. Not compatible with Swoole > > In my opinion, Swoole is an important part of the PHP ecosystem. But now, > Fiber cannot work with Swoole. And based on the above reasons, Swoole will > not consider compatible fiber. > > We would expect some ZendA

Re: [PHP-DEV] [VOTE] Fibers

2021-03-08 Thread Peter Stalman
Here we go again! Looking at you, attributes syntax. Seriously though, any of `this`, `active`, `current`, or even `Fiber::self` are fine with me. You might have the same issue with that last one. Thanks, Peter On Mon., Mar. 8, 2021, 14:57 Larry Garfield, wrote: > On Mon, Mar 8, 2021, at 1

Re: [PHP-DEV] [RFC] Fibers

2021-01-08 Thread Peter Stalman
Hi again Aaron, I've been playing around with this for a bit, and I have some more questions. I see you recently changed how the `FiberScheduler` works, making it `final` and adding some "is" functions to match it more to a regular fiber. Since the `FiberScheduler` is itself also a fiber, why doe

Re: [PHP-DEV] [RFC] Fibers

2020-12-17 Thread Peter Stalman
Hi Aaron, this is very interesting to me. Can I ask why this approach as opposed to other paradigms like promises, coroutines, etc? You mentioned async/await in the future scope, and I assume most of these patterns can be implemented once there is an underlying functionality. Basically, why fibe

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

2020-06-15 Thread Peter Stalman
Hi Internals, The problem with proposal and arguments about these "fixes" is that it's usually white people arguing about what is and what isn't offensive to black people. And isn't that the most racist thing about this: white people deciding for black people? No, it doesn't make you a better pe

Re: [PHP-DEV] Numeric Type

2020-06-09 Thread Peter Stalman
Hi all, One thought is that `is_numeric(true)` will return `false`, but the `int` type-hint will accept it as a `1`. The other thought I had was no one mentioned floats, so maybe a `number` type could be argued for but with mixed types that can be solved by `int|float` now. Thanks, Peter On Tu

Re: [PHP-DEV] What to do with ext/imap?

2020-06-09 Thread Peter Stalman
We use the extension in several projects, and looking at packagist, all the imap packages use it. I wasn't even aware of the horde imap client mentioned in the link (5 stars on GitHub, not on packagist). I think there should be a long deprecation period before it was removed, which would give tim

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

2020-06-07 Thread Peter Stalman
On Fri, Jun 5, 2020 at 3:10 PM Ilija Tovilo wrote: > > Hi internals > > > I'd like to announce the match expression v2 RFC: > > https://wiki.php.net/rfc/match_expression_v2 > > Small reminder: Two weeks have passed since I announced the match v2 > RFC with little new discussion. I'll leave it open

Re: [PHP-DEV] [RFC] Nullsafe operator

2020-06-04 Thread Peter Stalman
> Hi internals > > I'd like to introduce another RFC I've been working on: > https://wiki.php.net/rfc/nullsafe_operator > > It introduces the nullsafe operator ?-> that skips null values when > calling functions and fetching properties. In contrast to the last few > attempts this RFC includes full

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

2020-05-16 Thread Peter Stalman
A few thoughts: 1. I agree with the sentiment that this syntactic sugar doesn't actually save any verbosity, so it's not really syntactic sugar at all. 2. There appears to now be another RFC by Pavel Patapau, specifically focused on a Guard statement as a new keyword (https://wiki.php.net/rfc/g

Re: [PHP-DEV] Shutdown Memory Allowance (aka Soft Memory Limit)

2019-09-24 Thread Peter Stalman
On Tue, Sep 24, 2019 at 12:01 AM Bishop Bettini wrote: > > On Tue, Sep 24, 2019 at 2:26 AM Peter Stalman wrote: >> >> When PHP runs out of memory, a fatal error is triggered and whatever shutdown >> functions or error handlers take over. >> >> However, i

[PHP-DEV] Shutdown Memory Allowance (aka Soft Memory Limit)

2019-09-23 Thread Peter Stalman
Hi Internals, When PHP runs out of memory, a fatal error is triggered and whatever shutdown functions or error handlers take over. However, in the case of error logging, or just logging in general, there often needs to be additional memory used to accommodate the final logging process. This can