Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111915 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50289 invoked from network); 22 Sep 2020 13:49:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Sep 2020 13:49:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 043F31804AA for ; Tue, 22 Sep 2020 05:59:07 -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,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 22 Sep 2020 05:59:06 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id k25so14060630ljk.0 for ; Tue, 22 Sep 2020 05:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=zNIuM6tBbcsQbv6QglGO5Ilw+Qtyu1DmoBRJGk8UrOs=; b=b4XdaXj8tva7NpWA45Hk2F1wMFJ3mcY3TytspbLSQ1/EeggAtUcoTUKxiEGrq4Pzbo 2r6RP8bD8cBJ+KP+UG9VeW90tzXd/sEbWGyBzUN0koVg8JPSl9E6gEjPzM9PT+0T5VAd 6suEzL7NkT+/m51bAOloqXJZ3LXDzfOmIV3t4NAhygPrdu3rebjtbPWZFMlstGZV6rzR B4I0fCRKSBQ2yG7mt6/3RZOPw4rT3jraTCqfxyMNCQ0YA3g5FKJZLEHT7O1hxDEfUsQC F2iOWjzv+Rf1Aj27QeYCPtPChJQa2Lwlb2ZUj3aA82ET/PzQWz+iJf6UsiWIYAs01XOr VW/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zNIuM6tBbcsQbv6QglGO5Ilw+Qtyu1DmoBRJGk8UrOs=; b=QqZJgySHEAJ0NuqKAyCM5ecTMMvzKdH5sGK1NOzOFx1qW5GVM5TMu8nETpqw8krcIa pscaNzvZj/dOf/uSSCy8Vsli1Ip2gqLv09sbGLVBMqy6n4lzL085lSn4LXDYBiZHk9fw FivH8BZQsZ+/s/4Z9oBS0wTGwXXYCUe8Ou/VU0p4lShYuNaCdV+sSowM13FUAntE+6uD db4hWpDIOuxO8ICtpRmL5NR2feQQzoVZBnLyXp+kvyvEfoFsJmUvSAyXleWvs8X+A7s5 9ulqnv4h+qD68nX3sigU0cptR/Dwt5rq/dj3eN8hrGFNva67jEaiKKAK5KMI9Le2SsQ5 4E/Q== X-Gm-Message-State: AOAM532DznpIxqAZrz3C+gTd8kirnq5HxH+xEDr7YqZdjoZkLPEzuN5A MCeMCtNiIXBMROk4kF6cpINa514wWLPir/idi4DdbZVZpfzkdCcf X-Google-Smtp-Source: ABdhPJw9g0d1RFRzPzdHdCpXg2Qk34zWl6OZIuUDxHkYySOAMe2WcfAZzkE9CnaTvO8JG2r/tCUUCAVnYFloUzsPyAE= X-Received: by 2002:a2e:b169:: with SMTP id a9mr1573010ljm.42.1600779542361; Tue, 22 Sep 2020 05:59:02 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 22 Sep 2020 14:58:46 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000fc79ce05afe68731" Subject: Attributes and strict types From: nikita.ppv@gmail.com (Nikita Popov) --000000000000fc79ce05afe68731 Content-Type: text/plain; charset="UTF-8" Hi internals, I would like to clarify how attributes are supposed to interact with strict_types. Consider the following code, split up into three files to make it clear that each one could have their own strict_types mode: MyAttribute.php getAttributes()[0]->newInstance()); Currently, what happens is that this code will construct the attribute, converting int 42 into string "42", even though UseOfMyAttribute.php has strict_types=1. My intuitive expectation here would be that we should be following the strict_types mode of wherever the attribute is being used (i.e. UseOfMyAttribute.php, not MyAttribute.php or AccessOfAttribute.php). Currently, we always assume strict_types=0. Is my expectation correct? Regards, Nikita --000000000000fc79ce05afe68731--