Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128391 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id D4E591A00BC for ; Tue, 5 Aug 2025 01:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754356393; bh=RPbdRt/4zrxb4KmKHWtJsbKDDGTsy6Iv+kXPTvlrIg4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=T/s0DaqrMUvb+yi4x1sYlTdLAgIs3VQ0CwePKwDY09M+tAhKcQE0fOAL28uMFXCqM bi/rVTYwH64bp20EuDYipT+tns1iThoe1e8pJRxsG0b2kTplgekbE+PfGG6ZrvrX89 YeFYYr8YHPDCXWDoXzCf/8YiYLbnb23Ahf1jCiYLJq5/G5f83pmDgxCPtnjYPrYx/D ITP9cuO/pcQlJopvRKFyhrbDLri9vnFST6fnylgElQb1mYumdS44wTYseDTSgM0+El 1tk0o5g9MsX3C5NLriaweOyESlObmzel7GU+49fhCMR7PVNtAb7KYNV1zChojRTZ2K zJ5IUnwfX4sPA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0C29B18005D for ; Tue, 5 Aug 2025 01:13:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 5 Aug 2025 01:13:11 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-b422b31b1c0so2980478a12.0 for ; Mon, 04 Aug 2025 18:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qbix-com.20230601.gappssmtp.com; s=20230601; t=1754356491; x=1754961291; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RPbdRt/4zrxb4KmKHWtJsbKDDGTsy6Iv+kXPTvlrIg4=; b=IJqWIhTonwdaDf0nkJB7OeyWnZXbxdeplWIA98qkNv/FKUZF/GVnt1X+TIfHC2pINU 5K+Y8VzR0Jyn34a4nlXjkHDzXl7+is24rmhzH0/hXrawwy1EZMShrs1ihhzAV8G0bqK1 oGC7T6mlOlHAYwgBgX0YlHLb1tV6cgzJTpOXbGWXPnAZ8WarrqZn7UsH/6ojF3ykOD1r /vp6KH95cQ5ATyyQ0Zdl9BogG4Hw458aUmf0Y6YUoh1O3LCNu/7wty944aRybAemqzNS K6X5MWJYQAH/3hLQ8HoIvv/k1yOowjyFpyCtucvBqSs197XI0VTfRpehRs0FnYDEHKhR iS1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754356491; x=1754961291; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RPbdRt/4zrxb4KmKHWtJsbKDDGTsy6Iv+kXPTvlrIg4=; b=C2HP6eCOTvRwzltN8Y+M09ZYy2GVgirfkqKmK2Np5mnrmo2YZGejhe3iipdNU6UwU5 GzN3+C6bAM6euXb9QH32M89l9FEKMnvxlz9wjPzNjS3aLDWSztshahcxxo+p8+Ey+6Kv RDK7QI9NJqpPWr+GPt1BJbjW9zX3MfXxNg9qIHKzAmsnCbgu1bg8wZ8Uwjhd1PQM7yzW slvj+hr9eqX2QFXoSOY5mlwPQb2sCcfGcbFYRRIGBPzk+xTuVDYZFtgmrFMR+u4UDYyK fCjdo0KzaPXeik5gHDtwZf0dIEhkW9vxYwUq8PHoA59lDdgEX3ZIXoyzgLxNkkdOdji/ AmVQ== X-Forwarded-Encrypted: i=1; AJvYcCVoBfmhqTcO+tFLhmlqfJRO0R8XXurE2y5kTNqssP17fDstzxeVxT+AVB+ix55HXLQeIIE6elXCSM0=@lists.php.net X-Gm-Message-State: AOJu0YwEZUzlJBERnDASMO9mhcNsv5APpdbnC9Q5tCwqApqcppymevJe uBUI96o/oS0nMjkOC0rPHuHFlXDwoj4pcaUU+Es/r7uK8b4NG41pwu8Ba/3yNXgiCDVeL4WCeac YxuEHBOS9AN4qqhitpR5ZweuxgcMjICwSJA0ISTtqKA== X-Gm-Gg: ASbGncsIwL0sWMbSiHIAjnYFYAbogeCD4YPJriZF2z8MtXREFQzMmnEoyTFYAQM3Kwv lef8KNT8kWtQm+BmXfW4ohm+8c0HxuenrektuBbqp1PgvG+yxRjN22JIceTPXSO72I928mf+xy1 EbsnnpcCs95dRkuqIVfs7MrObfJm17jNZ1F7gbnAJe8jPMZ8aUFZaKGzRvZ8+9NIXC/kTAcTI0S dlkjg== X-Google-Smtp-Source: AGHT+IEVjxdK+uc6dbdHwNZOXY/tmjz9SETn+mLtcQv0nx33c9nR5NXUcRJtqiw/95Gn3Qp78GhVfRhTXV2nDw232lg= X-Received: by 2002:a17:90b:1c90:b0:321:38e0:d591 with SMTP id 98e67ed59e1d1-32138e0da58mr8852343a91.17.1754356490674; Mon, 04 Aug 2025 18:14:50 -0700 (PDT) Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <1744099889.304344.1753813282179@email.ionos.de> In-Reply-To: Date: Mon, 4 Aug 2025 21:14:39 -0400 X-Gm-Features: Ac12FXyZfQ2t2kqzs0GMXbLkFULivX3wLdYPLU909K-14VtH7uIcKvxWpTiDUIw Message-ID: Subject: Re: [PHP-DEV] Three proposals for PHP 9 To: Alexandre Daubois Cc: Thomas Bley , internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000006fb898063b93f384" From: greg@qbix.com (Gregory Magarshak) --0000000000006fb898063b93f384 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That would be great. To be honest, the biggest bang cod the buck would be switch_global_context. Just that alone can turn all existing php code into something that can be adapted to evented programming (amPHP, reactPHP, Swoole and FrankenPHP). As it is, only Latavel Octane and a couple other projects have dared to redo everything. And the reason is all the static functions, static vars, global vars, superglobals etc. If one can just switch global contexts with switch_global_context as easily as they can switch sessions with session_start, that would be a game-changer. Of course then we have the question of too many contexts in memory at once, so we do need to serialize them to disk, and that=E2=80=99s where I think encryption-at-rest can be transparently introduced, with a key specified at start. It can also be re-used for storing session data and lots of other data. Just another example of PHP nicely taking care of things for us (like it automatically hydrates the superglobals for us etc.) This is idiomatic PHP, it is shared-nothing and is the only web hosting runtime that=E2=80=99s actually safe by default =E2=80=94 safe from leaking= secrets, memory, etc. across requests. These two functions can keep it that way, leveraging all the code that=E2=80=99s already been written assuming shared= -nothing (php-fpm) and making it work in the evented paradigm, where leaks can happen. If we do this, I can see php developing an ecosystem of asynchronous drivers just like node has, for I/O with callbacks (using select() underneath in POSIX systems for example). Already the amphp and other ecosystems have the basics: https, mysql, etc. But the advantage would be that PHP would remain safe, by having devs build on all the existing code that relies on its shared-nothing architecture (from Wordpress to Drupal to Magento to Joomla to our platform etc.) and just making it 10x faster and evented Until then=E2=80=A6 I guess I=E2=80=99ll just use curl_multi and batch requ= ests together clunkily through closures. Sincerely, Greg Magarshak https://github.com/Qbix On Thu, Jul 31, 2025 at 5:15=E2=80=AFAM Alexandre Daubois < alex.daubois+php@gmail.com> wrote: > > Thanks for the suggestions. Maybe add a new function > func_get_named_args(): array, would be a good extension to > the named arguments rfc. > > I even wonder if this would require a RFC? If not, this is something > that may be proposed for PHP 8.5. > > Best, > Alexandre Daubois > --0000000000006fb898063b93f384 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That would be great.

To be honest, the biggest bang cod the buck would be switch_= global_context. Just that alone can turn all existing php code into somethi= ng that can be adapted to evented programming (amPHP, reactPHP, Swoole and = FrankenPHP).

As it is, o= nly Latavel Octane and a couple other projects have dared to redo everythin= g. And the reason is all the static functions, static vars, global vars, su= perglobals etc. If one can just switch global contexts with switch_global_c= ontext as easily as they can switch sessions with session_start, that would= be a game-changer.

Of c= ourse then we have the question of too many contexts in memory at once, so = we do need to serialize them to disk, and that=E2=80=99s where I think encr= yption-at-rest can be transparently introduced, with a key specified at sta= rt. It can also be re-used for storing session data and lots of other data.= Just another example of PHP nicely taking care of things for us (like it a= utomatically hydrates the superglobals for us etc.)
=
This is idiomatic PHP, it is shared-nothing and= is the only web hosting runtime that=E2=80=99s actually safe by default = =E2=80=94 safe from leaking secrets, memory, etc. across requests. These tw= o functions can keep it that way, leveraging all the code that=E2=80=99s al= ready been written assuming shared-nothing (php-fpm) and making it work in = the evented paradigm, where leaks can happen.

If we do this, I can see php developing an ecosystem = of asynchronous drivers just like node has, for I/O with callbacks (using s= elect() underneath in POSIX systems for example). Already the amphp and oth= er ecosystems have the basics: https, mysql, etc. But the advantage would b= e that PHP would remain safe, by having devs build on all the existing code= that relies on its shared-nothing architecture (from Wordpress to Drupal t= o Magento to Joomla to our platform etc.) and just making it 10x faster and= evented

Until then=E2= =80=A6 I guess I=E2=80=99ll just use curl_multi and batch requests together= clunkily through closures.

Sincerely,
Greg Magarshak

<= div class=3D"gmail_quote gmail_quote_container">
On Thu, Jul 31, 2025 at 5:15=E2=80=AFAM Alexandre Daubois <alex.daubois+php@gmail.com> wrote:
> Thanks for the suggestions. May= be add a new function func_get_named_args(): array<string, mixed>, wo= uld be a good extension to the named arguments rfc.

I even wonder if this would require a RFC? If not, this is something
that may be proposed for PHP 8.5.

Best,
Alexandre Daubois
--0000000000006fb898063b93f384--