Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119353 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6894 invoked from network); 19 Jan 2023 18:23:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jan 2023 18:23:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ACF911804D4 for ; Thu, 19 Jan 2023 10:23:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15576 212.103.64.0/19 X-Spam-Virus: No X-Envelope-From: Received: from mx.kolabnow.com (mx.kolabnow.com [212.103.80.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 19 Jan 2023 10:23:29 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 9E1201435 for ; Thu, 19 Jan 2023 19:23:25 +0100 (CET) Authentication-Results: ext-mx-out002.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :mime-version:date:date:message-id:received:received:received; s=dkim20160331; t=1674152602; x=1675967003; bh=vgZjnT3sWdjnMs6L aUr0slESkpjpEmiilewIRJw8pWY=; b=zOJNPHe7rmsgDTqb2975amdnL1dmzzRN qLD6/kxjAjLEKlAQC/VdNZmgNLDibrpBjJaFsJER4aatBfjlLoXNoXGOIxNcxPcQ Hnx6esyMPWRrvt0vHW87SNf7Dn2a71wJicgXVLPmZAyIUUNxB81BmGkCQKpsoUqO J6v9DivPsFEmiXMoQOGZCDt3BZqcMwuOrFiepoJpwLLaHPeYwibC4a6mNNMScZm3 Oa2Rsh1tfC/bUNC5gP6D4DhhI4TacNOsppr4RXSnSLs9PiZ3d6b50FaVIEe4BIlE Fm/p7ljPodkKN35i1x6Bmgq6+I1I6okfO2C6s71yLRj8AolqgFU7dh9RpHbrNWtW dbY9CDu7NgxVHb4xE8m43jOdCOjh/ZqtWbt+PIXOSkkO1Fzjc6x/nrPNturXozgV Ca0897biW/0k2CFB7c2ugHEv4Lld0U1dUtfK1FJ5bFxMcInM2Re89c3r6lWhSpCU bitTK7ZY72Ldj5zVCz0Yoz/3FQ+hf6BB0QENdDZa/7jHoihVeeAs2BBfa3vRJi/o XqJBH3UhkS9MQXkjbc02hhD4LyG/Stb7aL7Qs7865hWg3vzRvP+3CXfpaJZdH6MV myDTV4OXarIvWpsJ7lHUxZUIw2GwZ+M5OPNmYbd4RfsOAP0QG+BtFjsAavkiDzVR 5IDFvRt5MTo= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yutb2E56eP1G for ; Thu, 19 Jan 2023 19:23:22 +0100 (CET) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by mx.kolabnow.com (Postfix) with ESMTPS id 39440141C for ; Thu, 19 Jan 2023 19:23:21 +0100 (CET) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 0AD5D1096E for ; Thu, 19 Jan 2023 19:23:21 +0100 (CET) Message-ID: <1b532bf0-7934-e693-ba01-32b9587d54f5@alec.pl> Date: Thu, 19 Jan 2023 19:23:19 +0100 MIME-Version: 1.0 To: internals@lists.php.net References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors From: alec@alec.pl (Aleksander Machniak) On 19.01.2023 17:23, Nicolas Grekas wrote: > Hi internals, > > Ilija and I would like to start a discussion about the following RFC: > https://wiki.php.net/rfc/pass_scope_to_magic_accessors > > When using magic methods to access actual properties, respecting their > declared visibility is often desired. Yet, accessing the calling scope to > emulate the visibility restrictions is unreasonably difficult at the > moment. This RFC proposes to pass the calling scope to magic accessors to > make it trivial to get it. Why not a new function, e.g. func_call_scope()? It could work everywhere, not only in magic methods. I guess it would be tricky with calls to the parent magic method when you need the "outer calling scope", but I'd like to see some reasoning in the RFC. -- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com