Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120942 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56426 invoked from network); 29 Aug 2023 12:17:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Aug 2023 12:17:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B67241804D0 for ; Tue, 29 Aug 2023 05:17:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 29 Aug 2023 05:17:03 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2bcb89b4767so65410311fa.3 for ; Tue, 29 Aug 2023 05:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693311421; x=1693916221; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TSk992JNnxMZGlFzhrN1OWd2Px/Oei3pwI1n0115BdU=; b=oKRlXTAUBW32FK2PADp83bGKdYYMV6drPsdAF7WXa1LwUw0JsP5JnKldMf7OD+n19O qiyJ3XiA9xdcj5OWDW0MSaOqF5MicQnGqxhvihgtcDBHGhRWJKp+ZSAXPceXgnZcCa8g sRSRodLXMNTAzFRB3fcZkLn/FmMahOL26XVKikHjfTMvQUJ5uPNn6wKdbnrhnsQPK0ry 3Z2vi1r2dKDXgn20bsPOSpPB2vbX2IXIdld09AmEsPXIWeahoLOdKowD+k243ZJlTFje 6myMWf7XQWXGtI1ccR2+CV+iBD0uWs/CvD9JDmTiCafB3mjkM9F4EmrzIogHE0RDTTlX awKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693311421; x=1693916221; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TSk992JNnxMZGlFzhrN1OWd2Px/Oei3pwI1n0115BdU=; b=KMlgwJ1QxRZNBGZYZvdidyX/7r7YJRq57cF3a8Wq4nx61oM7s2KMYyu7dJ2yMI11bU zZDmdwK7pw8uUB8p858ndidemZ2v0Lv80pLpTJIdbVAao7oYASZ0lNjliREIrd8Q+PMI hPDVDAN+gVjqpqSCTjO+3qLJKTjy7KN4ycrKfXKbYeyWXR5dRp2Y2s4nMI0J7nQ7RQ4d ulevVibYlvSsCnUtPihh6fl19bfPar7F5Dgo7iYT1/rfik6RuvrtqqLMG/rK8R5yK4X6 gGPQgxU2z8bpZCo3dxg+wf9NSrYuk1DQYxZwSXNE7tQXtGPQ2mNLB9fPgVTckmYhM1YV okSg== X-Gm-Message-State: AOJu0YykYZU03P6L3n5SG5BhCdvGljMk9LsOKrwI5GSAf5GXyqkkGLgd RIvV80RntEFcJUj0A/DRktqulFKRX5RovP5s X-Google-Smtp-Source: AGHT+IE2PeJmeuVsHsW5fS33iAC88eggtTfxeZ2dPGz6i7RF/sbZubv1UXSHPlj77iyq13dbU+xkJg== X-Received: by 2002:a2e:2e0e:0:b0:2b7:2066:10e1 with SMTP id u14-20020a2e2e0e000000b002b7206610e1mr21318841lju.0.1693311421127; Tue, 29 Aug 2023 05:17:01 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id dt21-20020a170907729500b00992b71d8f19sm1581282ejc.133.2023.08.29.05.16.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2023 05:17:00 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) In-Reply-To: <4406C50C-18FF-4F20-BA7B-206E86610CCC@sakiot.com> Date: Tue, 29 Aug 2023 14:16:49 +0200 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <245BD1CC-7D54-4CBE-9640-5C8FF5225617@gmail.com> References: <4406C50C-18FF-4F20-BA7B-206E86610CCC@sakiot.com> To: Saki Takamachi X-Mailer: Apple Mail (2.3731.600.7) Subject: Re: [PHP-DEV] Apply strict_types to internal functions From: claude.pache@gmail.com (Claude Pache) > Le 29 ao=C3=BBt 2023 =C3=A0 02:46, Saki Takamachi a = =C3=A9crit : >=20 > Hello. >=20 > I=E2=80=99m Saki Takamachi. >=20 > Inspired by the issue below, I'm thinking of proposing this RFC. > https://github.com/php/php-src/issues/12055 >=20 > As the documentation below states, PHP's internal functions currently = ignore strict_types. > = https://www.php.net/manual/en/language.types.declarations.php#language.typ= es.declarations.strict >=20 > I think the current spec is not intuitive, > so I propose changing the behavior of the macro = ZEND_ARG_USES_STRICT_TYPES() to allow internal functions to accept = strict_types. >=20 > I plan to make changes in zend_compile.h and zend_compile.c and do the = changes myself, I haven't written any tests yet, but I'm thinking about = making changes like this. > https://github.com/SakiTakamachi/php-src/pull/1 >=20 > As per How To Create an RFC, I will first try to gauge response to = this proposal on the mailing list. >=20 > Thank you >=20 > Saki Takamachi Hi, The larger issue is that higher-order functions do not inherit the = `strict_types` mode from its calling code, and this is not specific to = internal functions. If you intend to change that for internal functions (with proper = deprecation period, of course), you might consider making such a = behaviour also possible for userland functions (probably using some = opt-in); so that future higher-order internal functions do not become = impossible to polyfill. =E2=80=94Claude=