Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87763 invoked from network); 8 Feb 2015 23:48:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2015 23:48:43 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wg0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:44746] helo=mail-wg0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/1C-26926-9D5F7D45 for ; Sun, 08 Feb 2015 18:48:41 -0500 Received: by mail-wg0-f41.google.com with SMTP id b13so3659089wgh.0 for ; Sun, 08 Feb 2015 15:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=SX5/Z65+eveYKKHIf4rhC0NkMzoJRZ2JWnKcMjj0eOk=; b=PpofoCI1X3JzSUCTgNdC7oe/D4+cEjQNwfBg+oAi8SAc0WmcyY18AlNWvaa42ETXtx bE0V8geicbq69reKDUC0gDFv8UmAlf6canl7UNcRjs39ICVabev3ZccAUfVpJNm1j4By 7e//eIX0qzcTzTtKCfBEKhbDHOT/N59UVa3PAn80wpovJN+sAdjsKrg7takGf49QHirE 2hG9fInLqykt9M7ImjIaE265PTZa2d8ZiqR/R4RnT8VaozmJK9tTxV438V1/796fzHeW 4tzKTtF2dEH6fl5iBANyfTrlGikchuEROH5LPBr1BHI/2IkXLMgo6vziRkh7b17KDHm8 LkZA== X-Received: by 10.194.3.40 with SMTP id 8mr33489356wjz.98.1423439318593; Sun, 08 Feb 2015 15:48:38 -0800 (PST) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id kj8sm13901499wjc.29.2015.02.08.15.48.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Feb 2015 15:48:37 -0800 (PST) Message-ID: <54D7F5D5.4050808@gmail.com> Date: Sun, 08 Feb 2015 23:48:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] uWSGI experimental plugin for implementing a WSGI/PSGI/Rack-like interface for PHP From: rowan.collins@gmail.com (Rowan Collins) On 08/02/2015 22:48, S.A.N wrote: > Hi internals. > > I really hope that in the future PHP 7, there will be new server API. > May be you interested to know about them, here is the link, I am not > the author of development: > https://github.com/unbit/uwsgi-phpsgi/ > > But the problem is that in PHP there are no standards for such interfaces. > Now it is implemented like this: > > > function application($env) > { > return ['200 OK', ['Content-Type' => 'text/plain'], 'Hello, world!']; > } > > ?> > > I think this is a good opportunity to review the old interface ($_GET, > $_POST, ...) and start using the API internal HTTP module. > > This all breaks backward compatibility, not $_GET, $_POST, ... > But this WSGI SAPI will used only new PHP code (not PHP legacy base). > > This is a good opportunity to create something new and not be backward > compatible. > > What do you think about this? The problem with creating an event-based API for PHP is that you don't just have to rethink superglobals, you have to rethink absolutely everything that currently acts as global state: - global variables - static variables within functions - class static variables - dynamic settings (ini_set etc) - globally registered callbacks (set_error_handler, spl_autoload_register, etc) - the counters of include_once() and require_once() - any function which implicitly fetches data based on some previous action (e.g. libxml_get_errors) If the language is not itself multi-threaded, all of these become arbitrarily shared once per thread the server spins up and reuses. If it *is* multi-threaded, you have another set of headaches about how both the engine and the userland can share and synchronize. Not that I don't like the idea, but it's a huge project, with potential for profoundly affecting the language. Regards, -- Rowan Collins [IMSoP]