Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105597 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58690 invoked from network); 5 May 2019 18:04:28 -0000 Received: from unknown (HELO mail-ot1-f43.google.com) (209.85.210.43) by pb1.pair.com with SMTP; 5 May 2019 18:04:28 -0000 Received: by mail-ot1-f43.google.com with SMTP id s11so9380336otp.0 for ; Sun, 05 May 2019 08:07:53 -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=sPlaalV0NJ/d5ro47wA2UECOABttV3XDu8fT6Y69GQs=; b=UI1BouDzwYkhXi+5Cuf8XgWf7Ry1UFBqFO/f7ZrORZ5F8hZT3aZPleIKl/PqKf5CPc +XqBzKeU058IZ0P/2zjptEvs3h29HhibOlk6juKGQqI8QsKWCjI/BVBQrGzXf9Aq9nqo ZQ7QYN1c2BZSiXUJZM/1Q7AoWK5Y/eKb/D3DON7pzLKZSdThISbP86cd182MAJ28NIh7 dOf3277rL5z2I6CxSWJ79ILNM6BehbvGF7MNGkQq+nMve9kXf5jpk99Je8V/VzoRubYA 4SB7Cy24zudVVOkBmQN2HbLtqXkcEvojY76Fn41s+lxpFTWhklBi9GewTg/2GCe7khcP vEOg== 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=sPlaalV0NJ/d5ro47wA2UECOABttV3XDu8fT6Y69GQs=; b=YLs2DYKjxHpDvAr7IhEzS6bMzxYJHZFHWXRsK1VUdIAUxTQVcyeBeFdFqxwGVg+JXb 9Eid9hjR8MQS69oOlid7C9Af5vYxBG/OmVC4ffH1SP23LeteKYoSq/3k0kPnCZ2CoTnA 8jg5ADwV6e5S53TsFaeEFK6RkZsdbIn7A7cY7KW0YE5p1tF5uze6GG2l9A6ULNdGhb5/ L+JbZD2q+BNQptphqTZ79fGm0HtKiCYL80aYzm8Ap/2PeUc7AlgMYmGnJYf5rx24tB1+ BN+vVyUQx0mtBa8SGy/mrLQ6VAtjUgIWRDhWhGCvrA6w+F5oWna4yLtYil/fRgms6lAu Cl8g== X-Gm-Message-State: APjAAAXlJWg6mRG407TsY8Bc4ULyYl4d6zpWmwZeHYlhftyGBiBtcGKr DHbSfKx+agtvN22hZY8wZiiigVwRbUTQw34op74= X-Google-Smtp-Source: APXvYqxaUqQUE1zF4tP8u3JamE3Cbps2LZRX9zqSilBwTeGvCRVY0tvK+wWXi5ssX0TaWLMkDDve7sG5HaPy54vSST0= X-Received: by 2002:a9d:2941:: with SMTP id d59mr14844337otb.199.1557068873415; Sun, 05 May 2019 08:07:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 5 May 2019 17:07:43 +0200 Message-ID: To: Marco Pivetta Cc: Steven Wade , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000173ffe0588255996" Subject: Re: [PHP-DEV] Proposal for a RFC From: nicolas.grekas@gmail.com (Nicolas Grekas) --000000000000173ffe0588255996 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le sam. 4 mai 2019 =C3=A0 18:37, Marco Pivetta a =C3= =A9crit : > Hi Steven, > > As it currently stands, the array cast is the only operation capable of > exposing object state without triggering any kind of access guards: it is > very much required for anything that works with reflection and typed > properties, and possibly the only operation in PHP that operates on state > without some contraption intercepting its execution. > > It is also necessary to distinguish dynamic properties from declared obje= ct > state. > > For comparison, all of the following have side-effects due to the > complexity of the language: > > * isset() > * unset() > * property read > * property write > * ReflectionProperty#getValue() > * ReflectionProperty#setValue() > > Overall, this is problematic, and introduces more magic that I'd gladly > avoid, in an endpoint used to work around all the engine magic (the only > stable one so far). > > From my end, this sounds like a bad idea, because it removes one of the > very very few referentially transparent guarantees (if not the only one, > when dealing with objects) from the language. > > Greets, > > Marco > I want to weight in with what Marco expressed. I have the very same concerns and they are major ones for many use cases. Mine is VarDumper. Please don't do this the way it is described. Nicolas --000000000000173ffe0588255996--