Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109632 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19120 invoked from network); 14 Apr 2020 16:08:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Apr 2020 16:08:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5BC171804F3 for ; Tue, 14 Apr 2020 07:37:42 -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 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-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (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, 14 Apr 2020 07:37:41 -0700 (PDT) Received: by mail-lj1-f195.google.com with SMTP id z26so12711401ljz.11 for ; Tue, 14 Apr 2020 07:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z+LZruVFkndSmhrGr6dMGnIxF2yguhy92/MPxpJKmsw=; b=d7xjpGosyzLFMd5sfcnFsXd7CZhLbo60QlUA9E0tBTiBoUSutjbpaxVRuWAcnMQSfM PL0y+Sdkf6bB/n71uYrTcTP5sFr+YdH5Tgz4mGD87ILP7E9oofkdKxTUZ82kD7xPNxMh YDuWuu3sV8RAEB9INOJ5FFJgNiCGi85c1qVFNIGm6910stzOnhM1j2oaVkINj7Nbs3DQ FEkBzbo2sjHcxr50rzkos0LylGwaCCgfL4itS3NialpDvpwoYYX93ymGK6sv52wJmRf8 iUm7SNP+SWtEiZH/MSI55wwyPRELeXCgeNwdXCkQRZSzF5NJ7HSIBQdhOzOkAum/z8DH k1yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z+LZruVFkndSmhrGr6dMGnIxF2yguhy92/MPxpJKmsw=; b=jDlspv1nqdXQhSq5mPyHp/gANadg1991vnnxhL8hxUq9oqqvCWUeGj3M2/sL2ImBAF hU06uKrD1/BVzubD+8SFqdjvlq7q1ima7cYXRklG78yQo56MRWb4vGS55eF7oAMItsiC 2sesvfT9cJFLR6ktMPdk5SbY8DU7oyEvA54pY896pmBVY3B5LVpC1e7nShsvugVgy6A1 wMVb94drMkxpAyqjMsdB1EPZb38+KLxewHulPNG2b/9I/dqCUHZ6AU7IHbpj3Rtlo/hG KLaHtNC4uYjJIZA/Fr3xfQKfTjWRRPMarsaH5Sk6WXF+UoMdmuL+7tzha0t9p6cHPyjq LtjQ== X-Gm-Message-State: AGi0PubTAhkHvXwrP0fv6X+kJBFcw8GWGBnVuEl5NpNeuKfUD66A6X7m sNpIebsXHONWDbdLhMg2WqHjhIUBSUbgX6yhcA== X-Google-Smtp-Source: APiQypI35R/4l75r2BXGqN29O3grTi35uPG29O91Q7/ncbdDzoDsVkFKka21lKmaLuBJ7/6tptwJM5mB+qffumqWL60= X-Received: by 2002:a2e:2c01:: with SMTP id s1mr312678ljs.56.1586875060222; Tue, 14 Apr 2020 07:37:40 -0700 (PDT) MIME-Version: 1.0 References: <90F4B395-F010-4196-9C40-7896D4F3F2F4@gmail.com> In-Reply-To: Date: Tue, 14 Apr 2020 16:37:28 +0200 Message-ID: To: Gabriel Caruso Cc: Nicolas Grekas , Claude Pache , PHP Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Ensure correct magic methods' signatures when typed From: guilliam.xavier@gmail.com (Guilliam Xavier) Hi, just chiming in on a specific question/answer: On Tue, Apr 14, 2020 at 3:46 PM Gabriel Caruso wrote: > > On Tue, 14 Apr 2020 at 15:24, Nicolas Grekas > wrote: > > > > > > Foo::__isset(string $name): bool; > > > Foo::__unset(string $name): void; > > > > Same comment about LSP, but also about the type: isn't it allowed to have > > integers as keys? How does this play with strict_type and array access? > > > Thanks for raise this. Nowadays, you can't: https://3v4l.org/pPJDt. But, if > you call as a method, yes: https://3v4l.org/0VmYQ. Actually there are ways to use integers as property names, but they are converted to strings on creation: https://3v4l.org/0k4LS and https://3v4l.org/HhPZP (also https://3v4l.org/Ts42B). ArrayAccess doesn't use magic __isset(string $name) but interface offsetExists(mixed $offset). Regards, -- Guilliam Xavier