Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80406 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72101 invoked from network); 12 Jan 2015 03:44:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2015 03:44:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:43801] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/27-34383-D0343B45 for ; Sun, 11 Jan 2015 22:44:13 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id 5C19D4B0178; Mon, 12 Jan 2015 04:42:02 +0100 (CET) Reply-To: To: , "'Sara Golemon'" , "'Pierre Joye'" Cc: "'Stanislav Malyshev'" , "'PHP internals'" References: <54B1AA31.6050703@gmail.com> <003901d02de5$53732480$fa596d80$@tekwire.net> In-Reply-To: <003901d02de5$53732480$fa596d80$@tekwire.net> Date: Mon, 12 Jan 2015 04:44:03 +0100 Message-ID: <005a01d02e1a$02d27a00$08776e00$@tekwire.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHdpO6kBDBjSAQ05ND+I0bfKmNeFQIeJCUTAflXB0ABzhWVuwG23BUcAlMscaecUWV/0A== Content-Language: fr X-Antivirus: avast! (VPS 150111-1, 11/01/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files) From: francois@tekwire.net (=?UTF-8?Q?Fran=C3=A7ois_Laupretre?=) > De : Fran=C3=A7ois Laupretre [mailto:francois@tekwire.net] > > If you agree, I propose this as a base to refine: >=20 > - Extension exposes only PHP functions and constants (no OO), > - Each PHP function argument must accept a scalar, an array, or both = ('mixed' > case). > - one or more PHP function arguments can be optional > - PHP function arguments can be passed by value or by reference. Adding these rules : - Constant values must be static (cannot be computed during MINIT). - During MINIT and MSHUTDOWN, no activity excepts defining/undefining = functions and constants. - No activity during RINIT/RSHUTDOWN. And changing this one : > - PHP functions return value type can be any scalar type or array. To: PHP functions return value must be a fixed type (cannot return different = types depending on context). Return value type can be null, bool, long, = double, string, or array. The resulting ruleset : - Extension exposes only PHP functions and constants (no OO), - Each PHP function argument must accept a scalar, an array, or both = ('mixed' case). - one or more PHP function arguments can be optional - PHP function arguments can be passed by value or by reference. - PHP functions return value must be a fixed type (cannot return = different types depending on context). Return value type can be null, = bool, long, double, string, or array. - Constant value must be static (cannot be computed during MINIT). I have pushed a first half-baked version of the extension generator I = was thinking about. Just for a look, don't try to run it. I started with = json and yaml support for metadata definition. We can easily add another = supported syntax if needed but these should be enough. Look at = https://github.com/flaupretre/php-ext-gen/tree/develop Fran=C3=A7ois