Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124879 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 qa.php.net (Postfix) with ESMTPS id 290181A00B7 for ; Sun, 11 Aug 2024 22:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1723416837; bh=Pz2DSGJ7h2k5iMT0gIViciK6twDzDFtaNIjVv/RjX/A=; h=From:Date:Subject:To:From; b=K960FI6GihI6N3Z3+vtxY0KSbAflfEPx2hCzUBqeS3BO3EQ/vCuqJS0fOYU6rrEGS EiB8rZZWPz1fcvvKY0AFoHD+apTluQITTFQ+TZlPgfZrqaoA+k4iWQbTTo8xqJdu+o ANRMVhv4H4ZTf7x6Xjc4jZ2BHcif2r5rTvPLfU5cTdPvJEhsrXwZk5Ea2OhWsnK7bS 8zvCFDUzGFxpEjoD/YRXE5eVtth7pAgcDamIMdM1KvdHz6mmLhSG6K1Pat/uoI8fbg unO1o7lLei5yYGU5RpeMQAgpC6sxKWbrTafVpEiaAwzf7AgTV33VGGmTIVuFg0Op5M 7Xvl1hvrepE/Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D770118007D for ; Sun, 11 Aug 2024 22:53:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (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 ; Sun, 11 Aug 2024 22:53:56 +0000 (UTC) Received: by mail-ua1-f44.google.com with SMTP id a1e0cc1a2514c-8205ceff95cso1251159241.1 for ; Sun, 11 Aug 2024 15:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723416731; x=1724021531; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=YDr59dr+c9JVIsZ+f1T+E0QTSwFRG+Ds2BFMQin6Md4=; b=BFlNVTv3xP+IdPjt3mHhb3JnwgZ+4gj6tdKBLmyXN2qDU+HCO++aJXpTt1nyWmBI3x wXMJ/qtVtpgcPKJra3kg8U8rSkdpCAS+3H8WyyENX7sJO9u89LNaXyNPDbTb8NSGntDy OSNzX/6YkJyv0qAzzmMVKviH6x04p4vMnHcZ+Ke+pOc0dljIbd4u6a4CZk+0oT6mJ8Xn jYaernqZvdSG1WHiWsRuhXZYfS1QvldjAgM3mc+/2QqwzQ1Du1QxXkT/aFZn0XscXESh dCLT17qVBADNKaOx+YoC3STF/8+w5DVhA6w449d+m2xQ/ZYkDunUk2T+LzRgZ4ruF5u5 mfMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723416731; x=1724021531; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YDr59dr+c9JVIsZ+f1T+E0QTSwFRG+Ds2BFMQin6Md4=; b=QkeKInsVe1GHKhEKDiFqpGbnyyM0PE3440ZT1VFey/EH/wXFI0F82v03p+QIJcOojn THYwXXrbxjXWhimJ/eWWmvMedIst8BRp0n09kYVgA07icntLXFECku6LSR2Dd1o4Mcor PJbL1oTRv1q1q+3MNKBug2R5RlrA4cFJXbw3HzsqVCfme2L70ng6LBCViFrw0ENq7sj5 zZ4wvfDnw2dy6f63SGNivK8HeRKTFS3C8G+d5qVYPup4YlNEHTnsQXkrwp1CM5f9p4jN Lvp0Gy6HZPBtsEThSuCV/w24PoOmYqE2a5+2VfS+psqjUrK9tbasn8dcwG4w5ck1i6Tx 683A== X-Gm-Message-State: AOJu0YzH+Wq87nKfMgFf+kAoDto2KNoitiGjlkFjHfl6aCTAXN5FFMEo rnv2/RBSYV6Cwmd1LB4P8DKLxXWArqDB5ThHpmMVE+tRuq4xPfICmDOATKYY2qlI4k477khYVBB pjfhdKtHfJhg0B8xKFHw5P2WcoPIEHYo6 X-Google-Smtp-Source: AGHT+IHYyvIqbrWoZ1bUntRMb070H85RT6GHRzqut79LvEypyCwhUD74JP9Q96A4aMiXEP+acKFGUFy3+Y75UomSyt4= X-Received: by 2002:a05:6102:e10:b0:492:9c55:aec5 with SMTP id ada2fe7eead31-495d845ac07mr9964303137.15.1723416730874; Sun, 11 Aug 2024 15:52:10 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Sun, 11 Aug 2024 16:52:00 -0600 Message-ID: Subject: [PHP-DEV] [DISCUSSION] C++ Enhancements in Zend API To: PHP internals Content-Type: multipart/alternative; boundary="0000000000000b3a30061f703a6e" From: lnearwaju@gmail.com (Lanre) --0000000000000b3a30061f703a6e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I=E2=80=99m considering adding some C++ enhancements to the Zend API. These= changes would be encapsulated within `#ifdef __cplusplus` guards, so they wouldn=E2= =80=99t interfere with the existing C implementation. The primary goal is to provide a nicer interface for extensions while maintaining compatibility with C. Key points: - **Struct-based Approach:** Everything will still use structs=E2=80=94no c= lasses or non-public/non-static members. - **Isolation:** Any enhancements that can be isolated from the C implementation will be, and they will reside in a common `zend_api_cxx` header file. - **Proposed Enhancements:** - Constructors and destructors, along with comparison operator overloads for `zval`. - Constructor overloads for common `zval` initializations. - Member methods for common `zval` operations. I=E2=80=99m happy to implement and maintain these changes. Since this doesn= =E2=80=99t affect userland, do you think an RFC is necessary? Also, if anyone has suggestions or ideas for this C++ API, I=E2=80=99d love= to hear them. Cheers, Lanre --0000000000000b3a30061f703a6e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I=E2=80=99m considering adding some C++= enhancements to the Zend API. These changes would be encapsulated within `= #ifdef __cplusplus` guards, so they wouldn=E2=80=99t interfere with the exi= sting C implementation. The primary goal is to provide a nicer interface fo= r extensions while maintaining compatibility with C.

Key points:
= - **Struct-based Approach:** Everything will still use structs=E2=80=94no c= lasses or non-public/non-static members.
- **Isolation:** Any enhancemen= ts that can be isolated from the C implementation will be, and they will re= side in a common `zend_api_cxx` header file.
- **Proposed Enhancements:*= * =C2=A0
=C2=A0 - Constructors and destructors, along with comparison op= erator overloads for `zval`.
=C2=A0 - Constructor overloads for common `= zval` initializations.
=C2=A0 - Member methods for common `zval` operati= ons.

I=E2=80=99m happy to implement and maintain these changes. Sinc= e this doesn=E2=80=99t affect userland, do you think an RFC is necessary?

Also, if anyone has suggestions or ideas for this C= ++ API, I=E2=80=99d love to hear them.

Cheers, =C2=A0
Lanre
--0000000000000b3a30061f703a6e--