Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124876 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 7D0FC1A00B7 for ; Sun, 11 Aug 2024 21:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1723413364; bh=KO3JU2iap9s47EjhVhyyjl+Ku/WD+wfC7YkSJYH6xr0=; h=From:Date:Subject:To:From; b=ndoYkGUyPLceqSYxUQZrnq5tB9kKLzKKH77CARLf9T7pR5o6N9kRL/fH9VzJ1OBRD LTXrjGmmjB21twYSQb4J6031Xa0aEChqQQB5CYJT4e2hCE+AwnrvRkPPFWZ9DRxqcF bDa8dcY39ut+LpfP/BOf1IFT3ZGsvIB+eDyYhNRDWxL98lZvxwZCfeFcP2ezF2mwf6 vQo3NphRsot8JDBRCnCOqDNGrzznfqo430oQ4Cv2235cl/ykVGNHo1hsND6mGUf4UC DlKY7MXd5v0gQPOlqwI1sdkmJOQ3/9W0CyCPnFeYvga+G11TNHJLgbvQq4N2JSKeAA LoXQeZQK0K/Sg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F0B6A180071 for ; Sun, 11 Aug 2024 21:56:03 +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-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) (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 21:56:03 +0000 (UTC) Received: by mail-vk1-f178.google.com with SMTP id 71dfb90a1353d-4f527c0c959so1067850e0c.1 for ; Sun, 11 Aug 2024 14:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723413258; x=1724018058; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=s1ou0Gme3gJGNBwhl+dvM8OV7JrJE73hRiWX2V3+weU=; b=VLCzfS6eJoPlDkROOg2RA/Fz6L3hwr00pjxfSRvoMfluQrU8eyOwkxlAqo5IY+hIV7 UL9YuaAvvXmp6++WHrJX1fvcNQMsTZbIxFh9Whz2olpqjT5dFHaV8bCd0enAaJB6JnmU Ar0Aq55TG0XfjTcVFxWED7NhBudVwFbbgoaqOeIMy/dERyp7s7mEOQH/0aUjk+c5Ia8G nxMiHGxqXgl477bLOGvCdRVYCqwty2M1jFbQUoKaM9bDj7Nt7/u6bZHd0U86fisntCUl unb7jAKgWysLfAcTCCS6cvkbnfwVIeSmhYOGMRwd8LOd7m3C8NCu0Elwfa6CFS/cpFCT Y12A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723413258; x=1724018058; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=s1ou0Gme3gJGNBwhl+dvM8OV7JrJE73hRiWX2V3+weU=; b=QAqjms8LOqxDyGOz4pxRceHPlXMyeSiR+97vP/0qhEcSqoBcF+8e8iUa9wkZH8Qv8U v6EV2WVGbY9J+3+qYuQCA9+6c5uyg6C5gYVs5h8shLk8TiPdJjoYCtdpvOAYuf0l3Kfl vNTT4X3KZUr1hmWbnmSNy7aKqbXpSN8DIcjX6KVFhCc8N+UHJFgAn1/iRp1mE8uUtiYV 7gpDCbviRzj52PWrT1watNokq99WTx0ooDeBDyjxJZlkoaOLiilAUAP/BIzkqIw6fh3H phwmXj+tmXOFmPu93VmiWe7mRsYk6xssICL9nA95rhMWd6iaCHm7QKEsrk7IZE7wgAOf Jz4w== X-Gm-Message-State: AOJu0Ywx2E4EOZ0OqqcP/l6pZti3mB1ohEpLI48mX/yXpfQRQTWKgWfb 9I9uXqHuRlMHnBdYix8NAhFc/0rHomKDMF85u8yI40cBEJbpoT5EEbNYkaH+sj00r6UvZXeYMZq sazFVpiM6SSrBmUvly5q95+IoRcnQ4fMb X-Google-Smtp-Source: AGHT+IFu89YtIRdaihuoStJ7G0nfH/qJvkIENdDjnkSf2WsiAJeJ3JAjP7XIgle0KuGZggYkZ6/Sxr2SeGT0M7w1YYQ= X-Received: by 2002:a05:6122:2916:b0:4f3:207a:c664 with SMTP id 71dfb90a1353d-4f913355ab3mr8912388e0c.14.1723413258033; Sun, 11 Aug 2024 14:54:18 -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 15:54:07 -0600 Message-ID: Subject: [PHP-DEV] [DISCUSSION] C++ Enhancements in Zend API To: PHP internals Content-Type: multipart/alternative; boundary="0000000000000bdfe7061f6f6b67" From: lnearwaju@gmail.com (Lanre) --0000000000000bdfe7061f6f6b67 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 --0000000000000bdfe7061f6f6b67 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 = classes or non-public/non-static members.
- **Isolation:** Any enhanceme= nts that can be isolated from the C implementation will be, and they will r= eside in a common `zend_api_cxx` header file.
- **Proposed Enhancements:= ** =C2=A0
=C2=A0 - Constructors and destructors, along with comparison o= perator overloads for `zval`.
=C2=A0 - Constructor overloads for common = `zval` initializations.
=C2=A0 - Member methods for common `zval` operat= ions.

I=E2=80=99m happy to implement and maintain these changes. Sin= ce this doesn=E2=80=99t affect userland, do you think an RFC is necessary?<= /div>

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

Cheers, =C2=A0
Lanre
<= /div>
--0000000000000bdfe7061f6f6b67--