Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82078 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63481 invoked from network); 7 Feb 2015 03:15:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Feb 2015 03:15:14 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.169 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.169 mail-qc0-f169.google.com Received: from [209.85.216.169] ([209.85.216.169:48520] helo=mail-qc0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/11-55814-24385D45 for ; Fri, 06 Feb 2015 22:15:14 -0500 Received: by mail-qc0-f169.google.com with SMTP id b13so15144880qcw.0 for ; Fri, 06 Feb 2015 19:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7y5xiiOEMqcwgZ1O1gS+et3FJPyA/y+WOwZMaBcdD+M=; b=OBxROyK8ZToKaM0sgjcI3WKzc58Mh3+7SibhKMuNN7X0qd4lv3ZEDeOIdOb8wwKoAE ysGAkNwzIr70fnQv71grfvZYXyCuRKNjuY6nJi8A9T8fClsuRw75g5yPKAHmHHI/9Nml um0irwa5fJCE2rkWQkbfaJkkD/cH/QRp9JXlIoigyzbOXmMKbC4rZFowLBdtPTC9P29k HNwWIZmpzoHpyy7ZJxzr1GM4miwH2sXL4y2+T9Lhgmv3vnoJ0a7LpBnpLXgmiYTtlzcy 9kUpP6247+id5iwXcNvK0qOrksSp7owULxo0Jzx0D8n1mvg/KJNpl1J6r+oxoYm7mH7r mHFA== MIME-Version: 1.0 X-Received: by 10.224.113.200 with SMTP id b8mr15006176qaq.35.1423278911910; Fri, 06 Feb 2015 19:15:11 -0800 (PST) Received: by 10.96.3.168 with HTTP; Fri, 6 Feb 2015 19:15:11 -0800 (PST) In-Reply-To: <035f01d04281$e1133090$a33991b0$@tekwire.net> References: <54D3EE95.2080109@lerdorf.com> <035f01d04281$e1133090$a33991b0$@tekwire.net> Date: Sat, 7 Feb 2015 10:15:11 +0700 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: Rasmus Lerdorf , PHP internals , Guilherme Blanco Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Annotated PHP 5->7 extension diff From: pierre.php@gmail.com (Pierre Joye) On Sat, Feb 7, 2015 at 9:57 AM, Fran=C3=A7ois Laupretre wrote: >> De : Pierre Joye [mailto:pierre.php@gmail.com] >> What do you think about the creation of an example extension covering >> almost everything one would do in an extension? >> >> The class, methods or functions do not have to be useful but to have sim= ple >> clear examples to display the differences with extensive comments. >> >> Doing so has the big advantage of being self contained and anyone can >> contribute easily. It is also easier for someone to actually play with i= t >> than with a diff. > > Maybe php-ext-gen can be useful here. It is a PHP extension generator I j= ust wrote, with the objective to avoid splitting extension source trees to = two independent branches, as differences between PHP 5 & 7 are beyond what = macros can do. The other objective is to make it easier to write a typical = 'bridge' extension without knowing much to the PHP API (without manipulatin= g any zval). It could be an ideal environment for an example extension. > > The current version already abstracts and generates code for argument par= sing, return types, ini settings, resources, functions, constants. The sour= ce for this is a Yaml or Json synthetic description and C code reduced to t= he bare minimum. > > It is based on pluggable generators, the primary scope being PHP5, PHP7, = and HHVM. Currently, the only implemented generator is PHP 5, but PHP 7 wil= l be easy to implement (it is based on twig templates). > > The project is at https://github.com/flaupretre/php-ext-gen. Look in the = examples subdir, the wiki, and tell me what you think. Not sure it will help. It is really about showing cases for deref, duplicate, convert, iterate, etc. The zpp, return values or functions/class/methods declaration are really the easy part here. --=20 Pierre @pierrejoye | http://www.libgd.org