Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120944 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61242 invoked from network); 29 Aug 2023 13:19:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Aug 2023 13:19:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 95C2F1804F5 for ; Tue, 29 Aug 2023 06:19:58 -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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (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 06:19:58 -0700 (PDT) Received: from smtpclient.apple (softbank060109141104.bbtec.net [60.109.141.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id ABACC401D8; Tue, 29 Aug 2023 22:19:56 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1693315196; bh=NS6/P/ZL/E08XVu63T38feR3f7msSQewx59PX8lvwkg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=k6/zq9spFhNEu9H8q0mFiKVgM8ha8LRZZFetf0m8m3tjVZhq6Kcg7+Ffwkhmb/dec Whng25OIgAqAZOal90dxsHrORdUjJQxAwiTe8w8+7WruBuH+4qxuvVrGoJEqIVZrUs rQyXj1iurz6aJJ5t6K4uryPNugflHWHmbMi9CFKQ= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) In-Reply-To: <245BD1CC-7D54-4CBE-9640-5C8FF5225617@gmail.com> Date: Tue, 29 Aug 2023 22:19:40 +0900 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <4406C50C-18FF-4F20-BA7B-206E86610CCC@sakiot.com> <245BD1CC-7D54-4CBE-9640-5C8FF5225617@gmail.com> To: Claude Pache X-Mailer: Apple Mail (2.3731.700.6) Subject: Re: [PHP-DEV] Apply strict_types to internal functions From: saki@sakiot.com (Saki Takamachi) > Hi, >=20 > 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. >=20 > 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. >=20 > =E2=80=94Claude Hi, thank you for confirming. If you simply put the problem you pointed out in the code, would it be = something like this? https://gist.github.com/SakiTakamachi/8292dbfe92a2029a6c7b506b12296b7d Admittedly, I don't think this is intuitive either. However, if you always inherit the strict_types of the PHP file that is = the starting point of processing, in most frameworks the settings in = =E2=80=9Cindex.php" will affect everything. When considering the inheritance of strict_types, I think that it should = be an attribute that can be set in =E2=80=9Cphp.ini" instead of being = specified for each file. What do you think? saki=