Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93477 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63123 invoked from network); 24 May 2016 08:23:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2016 08:23:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.130 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.130 mail-by2on0130.outbound.protection.outlook.com Received: from [207.46.100.130] ([207.46.100.130:2213] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/A4-37212-E6F04475 for ; Tue, 24 May 2016 04:23:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4MExWyD/qL/LC+kIG7T7GvLP4e+uXpcIDE/alZ6QeLE=; b=XqJPK7B/yo7CNLjP/hkopmHcL9KCx2of8Cl/d1vChJHhGLDBjoso2f20aaLbjAF6E+y6PJAl31clWH10FOJ4dT9ec8azSaVoPCK/xb//SbiUgBuIkGd+383CzYxmA2G9PgT8dWqsEj4xZ0pBv/4R/m2/2UUPxM0bQfzNIrV83rw= Authentication-Results: php.net; dkim=none (message not signed) header.d=none;php.net; dmarc=none action=none header.from=zend.com; Received: from tpl2.home (92.62.57.172) by SN1PR0201MB1792.namprd02.prod.outlook.com (10.162.228.24) with Microsoft SMTP Server (TLS) id 15.1.497.12; Tue, 24 May 2016 08:23:05 +0000 To: Stanislav Malyshev , internals References: <478356f3-cc53-d419-cfea-0a6bbd782031@gmail.com> CC: Nikita Popov , Bob Weinand , Xinchen Hui Message-ID: <37c30acc-b657-97c6-3f4f-73b5eceec198@zend.com> Date: Tue, 24 May 2016 11:22:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [92.62.57.172] X-ClientProxiedBy: VI1PR10CA0001.EURPRD10.PROD.OUTLOOK.COM (10.165.230.11) To SN1PR0201MB1792.namprd02.prod.outlook.com (10.162.228.24) X-MS-Office365-Filtering-Correlation-Id: 8aac99b1-18f3-43da-9589-08d383aca266 X-Microsoft-Exchange-Diagnostics: 1;SN1PR0201MB1792;2:OIKAwDchqqzUn4phqX5XwZXHKcwXD8KhCwmI9S0byuqXHzVHrcyyyLjifbxCoLxPxUwfz0aA+oC3S/tiYM/t5z7JioAEnas4YjoRW7HNarstN9vg7ATXWv4eGqQ4u5xsTJZmzS/QegD4KyPqBTBH2tmwWmkwJlCz7tMlyxJfsaGdEvcTxkfvlr6GMMowT+XA;3:a0ewviaLfFx0m9nqV/wMelN6AsYZTT4lkmZpa8r28fY0zZ6R6h4OI/AyN4uJOkC282FtWzdTINMjACrqFzaEBg4VkOnqPJJNzVcC/OFbFsMHZg0KUy1mpAhR6TVxdMNr;25:EhSB/v/HoVkIKijg8wEpRGKJZkiffibMaVvHaARxK7DYVww338QZYPy3rt9oXDgV0QQ9lNCjnlZMf0VNxAjaMch6Q5JJv+FgJyrAfwupn6F/5DEnE52p8dvo1jyiZKI01BhH5n0TP5d1C/JTOr//YXXqavPUv+2miZz+vFcS99YnLIj0rjiIT6YzCk2tmGZx9ozjgFyGHHJMWb4P17FqlBvYH1jUDDthm143tApbMjOH3v/UyXlptJ7EqlLt1GCcum7UiXg02OtI17m+LBeGmeqMFM8pr2gSdol5XAfDpqxz483n0g6JWADLgBy92eYtbc7z4WXW0VhwUzqAX+O7rR6M6Fb2NBoxnxDf/HXn/CCS4PRn8WX09tUllwgWECfI7TfkQqklLtQm8Erry6XHnaFXrFVhd47/P4mIRdmrt+A= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0201MB1792; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0201MB1792;20:r76wzQn2+VRd5PAcvUzHZeHy6I/xZpSc7GUMMNkAqbdswTWefxQlvufZP2mTgcLeqBo2BS46a6DbJzZfPTKb5pX5zbsaPDSHiwoize1JFvMJySO1jR52rOhV/HVlY8eR0M9cojvNdPNcIeounWmRWkKlZGJwaCHVSEBZ94Wqio1siPd6SAmkh/gmG0boZjku4XX+T9cTOZM3EtVZNs7F0wezKmOjrvZeKFjyNlYqwHoLHjRYOdMsYLHIb+WFKDfXKFcalZR8iBb2+yZx3tOAgLW01POD7Os2eMFjZYNpXFwvSWfGwo17PVhDksselbtTURpCxbTExrNfFd2L1xZcZ690A9RpkMFkSrxIyAE+scyIFRnQVSPnPzQQxRk+Il9nI0qyQuszLO+Av8wng/d5dVbiqnPs6fFwrpHXc9gcpIrmsKVdnYWOUpbcTOh8ligQAF4JO6vwhTXwjjLTkB3+NbaN5uh4RuBK/ypUjyd/XjD+1gmZ1Z7ZOSnoXwWYUR6j;4:1XzZf98sslDLzLNkOLOtgP2J4UaWrXT1jlxXgObyCHxOFZqG5bASCzF2qKzJRJuU1GevEabO11x6DQJ4IVohxYErNWhHZ1z93gb9RGpG6FCX4QU0TOvWcelr1FeQwnHc7a8Rd0q6e8ySG7vkHYxLH4xcy2PJrQCJk9DjHzTRaeR5uZ1s3IAfF5Wa0Ars0aGSbiORi7w7DtInDFwTH+z7Av7j9lf1BRlA7p9DN4obvUS+B93IIABjwXJw/ICEUImf3eYDeV3QSSShcG4tyr9DgbeTvLAfhfUt7xltKM0UI586BnEeunl1wG68YhfS77VrgERyNt79yBBXPQlAlgkxy8VMiD499OyS4WgYWIgDKLDrwmOpT6lbfy6v5P2uV1ny X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:SN1PR0201MB1792;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0201MB1792; X-Forefront-PRVS: 09525C61DB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(377454003)(24454002)(15975445007)(230700001)(93886004)(83506001)(23746002)(31696002)(2950100001)(19580395003)(77096005)(31686004)(65956001)(86362001)(65806001)(66066001)(5004730100002)(36756003)(54356999)(50986999)(76176999)(47776003)(42186005)(6116002)(586003)(4001350100001)(3846002)(50466002)(81166006)(5001770100001)(64126003)(8676002)(33646002)(4326007)(189998001)(5008740100001)(2906002)(92566002)(65826006);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0201MB1792;H:tpl2.home;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;SN1PR0201MB1792;23:rqkmzbNH6IwwEQdT9TRmj62jeLL+fGQLWDi?= =?Windows-1252?Q?8CACavbEwubNeo4AzRnFH60DFx/+TI1vcE6cBIWVIkwExYsRTegTAaS7?= =?Windows-1252?Q?ZRPF422AvkB2iOjvWQYju+FHQJ2VolarHNvacweSQfT1RAqbelpDwD7l?= =?Windows-1252?Q?16L4U89HfqWhc/1DJPbztFWqrb2ZsBs0F7GOmmXJIepJ6/t6sfE2btRC?= =?Windows-1252?Q?W+V4mOHuHoM1icCCGHubWEPNExCitp9C2tJ+WK4XBvrydJqMgsjeZ8Vt?= =?Windows-1252?Q?iCcIFc8QlKYbM+Fl5JkskBAn0yHILFFHaAVa6+X5jjXo2ybEYl73GDNM?= =?Windows-1252?Q?ATgB1LgXtbWFm81Pb0dhVJITmKRFrKjhAaDEbMHQf0HhEYuOXL3noFH/?= =?Windows-1252?Q?v7xiYNowj/GLFzbyJRAIfaX8BNWjfoj4TKqRFEQmh6LD0W/c63jo3jfq?= =?Windows-1252?Q?TLvza6fnj1TfmRiVmjV8QVyVZba/6zS+gZYqwdtnRd0Vl/ejoN+fYZgF?= =?Windows-1252?Q?I/ntPe8Zvww+PxTIJ0lLGxbPwEOhDLWFrXVvcewMSXSFg8+x+l4AQs45?= =?Windows-1252?Q?BeLNaIDZUSEEir9nqX83SSBqdJzYQvcjPJ5J3CNK0oVXdadrWFZ8oMxG?= =?Windows-1252?Q?79qQ1JPXREvUKghdAevoWWCDNr7uaPXngnoWqEO7oHEeEVjJkBM7TMRi?= =?Windows-1252?Q?+mqyGl577XN96b/4p+CjfhQir9FhRego2qhAdR1WllcivgyuHtKPRKOY?= =?Windows-1252?Q?aU4fhIbwTj6XhrykOHDdhZMYnMDbLkZA/HIrkVILm80D2VhS9WwJlIMq?= =?Windows-1252?Q?3Bii8Gjp2pKS1lDeFdd4ne9HQYdqnEm7CMbJxg9Ud7hZF7lvZzLBJy/I?= =?Windows-1252?Q?7MSBBSL3oN6m9xtghhnTAvWy65hdM0M/NaNWR9JwLBuwSx9h3ZVkNKp/?= =?Windows-1252?Q?MI11mv18qQ6QrKGnavZmTERPfJEx3FOcUBO8iM09V9cAg2k19OwMJLVs?= =?Windows-1252?Q?TzHANGbP+LCp6gArE6+8s+I2Ul2tSgcr114ARXvdgCUq4liiK1Dywar/?= =?Windows-1252?Q?ClPncy6CiYTJox9UV3RGRpSiTfaLCx61+6EH9o7mQt5kiaqj37dXUZnq?= =?Windows-1252?Q?MEE6qEmRvmHK4xW7ZESWvsofXDkCn6LJIR31f2YGEJb8KaGk9f/ZaAxn?= =?Windows-1252?Q?wcVTZzrABIQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;SN1PR0201MB1792;5:0dPAig63K/lXulTDgyq9FTF34Iz3JyclhuFZp8q/CcHLPCNBz/PI403v9v0ChRUC3jQ0olJgF2b1c6ZrqJTcTbMBKL1xA/2vDFyetjaMM/XALdiqOWIv3wwoAwv2h4r+YqhupOoYlvVJrYAFW4z0Ew==;24:nndMUotii2SzyU9L5xVmYnG6uyd3P/RVqRkR1x6AUdnL+yz8fhuuzjlLE6j1DhgVuz9kYz+hWAIInW3ZS2cu8UNs3+bkPbze+UzurBC+HW8=;7:F2PsKSqoTtrketmQjTZ1vuiLRlcfYuECWJqK35777Eig1LQczNLk9XiAn1LNvZSt56eDRsFvU56a17sIL2Gu3l+/MFdDthyRvF4LgB+24Da+WXSys9OQh6iO/r0Ct9jOwSiW9vignOmtH1v9z1IkQlXlJz0t484ZcBp72SqTGE8xSdfeuVi5QcZ093V4Oc5T SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2016 08:23:05.6304 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0201MB1792 Subject: Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable From: dmitry@zend.com (Dmitry Stogov) On 05/24/2016 11:04 AM, Stanislav Malyshev wrote: > Hi! > >> Keeping inconsistent behavior isn't good as well. > It's not good, but it's not also very bad. Nobody really does that, so > whatever happens in these cases is mostly irrelevant. For me it's easier to check and fix all inconsistencies at once. I may set an additional voting question about performing these run-time checks and throwing corresponding exception... > > Did you test performance impact of those changes? Of course. It's invisible on real-life apps even in terms of instruction retired. > >> Actually, $this may be assigned to local variable in run-time only in 3 >> places: through $$, extract() and parse_str()/1. > For now, maybe. But every time we do something with local symbol table, > we'd have to do special case for this. E.g., throretically, what if we > wanted to add function to Closure that allows to access to captured > scope - we'd need to special-case $this there. Etc... We shouldn't access local variables in irregular way. This irregularity makes extract() and parse_str() to be special and they require special handling. See Nikita's RFC https://wiki.php.net/rfc/forbid_dynamic_scope_introspection > >> If we remove this checks, we go back to 7.0 behavior - we create a local >> variable $this, that has nothing in common with real internal $this >> stored in EX(This). > That's not good, but maybe we could make them agree in some way? What do you mean? Change the real $this to something else in the middle of the method??? > >> In most cases it doesn't show $this in 7.0. > Right. But you're changing 7.0 behavior anyway? > Right. And I don't see reason to show $this in get_defined_vars(), because it's special, and not really a local variable. Thanks. Dmitry,