Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106306 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89228 invoked from network); 28 Jul 2019 05:52:51 -0000 Received: from unknown (HELO mail-pl1-f176.google.com) (209.85.214.176) by pb1.pair.com with SMTP; 28 Jul 2019 05:52:51 -0000 Received: by mail-pl1-f176.google.com with SMTP id i2so26210114plt.1 for ; Sat, 27 Jul 2019 20:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nEftoExQDocYYlfmQBJmppfKvp4rAtAxglHLKN5lp8I=; b=KTbcDE3NhpaI7HVKke1nOyOvcSlAqCCEylBtdu4OtgVeqoXyQNqa2zAlmWQzVKU5JJ WHyqSWRwYifdN/6QIKZU6ZYY7ky6EiIwwerNRR9tbHAyynCKRUSYkAvAfvkvBBJIFNoO 1rL8JdP8D0Hq8AOpjEh/awsdZt7mJIXlkLmURu9GUCeZMq5S1SvvVfBqWzz5wONE/n5Z VOZ7zxe0/lAR46Po6p8AyTthJGXedvYeF7PZPbX6diLy7Dsl8xWlWgGLdn7pV3aBrmTL kuHACAOudff6H8IlaOTwrpzwNFN4jhLjDxYCjzbGZGmECPBqpfbhv8ZCcmaNxDJS94zh HmeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=nEftoExQDocYYlfmQBJmppfKvp4rAtAxglHLKN5lp8I=; b=tQ29j/EDmIF/IA8m+E2Ze1pVHY2FRiqP3PbAxTPq9qDe84lJE5KIUcXZ5o+JdDUw0r fTjC+mZON5wU1KgtK9QWcliMLvqS8vcZ5V5ISJ7aGPnlc7EMrgbmsJtOAqchmxd9of7t XK7SbCritduv2hJLdOsyB4ozJmAx65Eok+Zel6UgaZsMEbpt9vBYxp6F0EE3SVwXryO7 eltHH4+jIhk9OlPW3lZNDYJ3AnF2E+MbwWGjsK8qtEtZh6SorFoM7Jex2NtdlcFWNcx0 0je/nJwMf4q2SGpfWxF7Oo+WfF628zyVPgvDVhmtc5RDM6yhszDqRjZ1fCMfaH42AeGA r7wQ== X-Gm-Message-State: APjAAAWXoMUssTyqSSXiWopDzM7brBlRZs3bE7CljQtGZyb2ygWMfs89 3JeNg2velg1BU20YON1EZB6ESd3zBw== X-Google-Smtp-Source: APXvYqw0ducBAlA/iFvucwX6P8tcr8WHiov9qNKdaI3CzbjuCjIS07fZRRi1GUcRKF+AcF+hnsumPw== X-Received: by 2002:a17:902:e281:: with SMTP id cf1mr100351005plb.271.1564283828413; Sat, 27 Jul 2019 20:17:08 -0700 (PDT) Received: from Stas-Pro-2016.local (c-24-4-176-254.hsd1.ca.comcast.net. [24.4.176.254]) by smtp.gmail.com with ESMTPSA id v12sm49083726pjk.13.2019.07.27.20.17.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Jul 2019 20:17:07 -0700 (PDT) To: Nikita Popov , PHP internals References: Openpgp: preference=signencrypt Autocrypt: addr=smalyshev@gmail.com; prefer-encrypt=mutual; keydata= mQMuBE9mqaARCACFSqcGmNunkjQQu3X+yXnTmFeEkvM4JXZTOBdR8aEevNGmmFEfyvjaDjWi 9hcwp4E/lYtC+P7VsVjM1OSX9eq0jC/lGL0ZyRXek+mNy0n5H1NSuTpf9Y18LMqhc4G+RU+L cNiZ9K0DJuOOvNLPxW7OHZguxb3wdKPXNVa2jyRfJAKm2uaJJMT1mTmFT9a0Q8SKr+mUrrJk uG0H2o6SzrKt8Wwoint1eh67zVsJaJtQFchnEZnlawIcqP2yC4nLGR3MkubowxoEBYCZet18 aHVVRbvpG2Qtob8Lu5xrsGbmXymTkHTdpvkfcJFADa8MzOL90zOxXwbGfbIZ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ulT1q6uCG++CX ubEvip/eJkZl93/84h04KQJwsgOrAh0Om3OePRn8Pr+++0LNS0EL8uX/YHeTOGOnnmTqYTey SBVFdov6L4mepddfjekicKQqhL7mZh/xuq29JijT0uNNX8v4vDWQDu5dlAcdd+uB3gcXMD/P ginD11zp+6wtrWCm/+yBqpvDwXQX5PGUnwvbRfl7Ay3MmwmoXiecZMg0dwTSc7e0lhB4HGRH ZdBMJB4rHUVGdzqujK/ctOvrAAMFB/0Utb76Qe6sCMlHxVAmeE/fbo7Pi05btZ/x01r67dHf aMSP0riCKJ7M0OW+jAXtu9+z/BVnYisW67WWfxl2cS5tZDgiHgJARXWUOO72+sScHP8KQmTl 1z16gyKbwY3SmyBkwcpOL35nhUWNLy93syPoY6sZUTikr2bZYukHDQ33XBPs4e6MbWKfsa9q aVmnlOF3k5UqChjutfHaEa4Q7VP4wBIpphHBi9MI16oJIzzBPbGl2uoedjwiZ6QeQZnSuOVY ZxU2d3lRA8PrtfFN1VSlpEm/VcAvtieHUYWHN0wOu+cp3Slr5XJVNjTjJhl28SlinMME54mK AGf2Ldr/dRwXiGEEGBEIAAkFAk9mqaACGwwACgkQL3lWvF2gS126EQD/VVd3FgjLKglClRQP zdfU847tqDK4zJjbmRv5vLLwoE0A+wbrQs7jVGU3NrS0AIl5vUmewpp2BKzSkepy23nWmejw Message-ID: <0143be10-1dff-58dc-818b-23e76345406f@gmail.com> Date: Sat, 27 Jul 2019 20:17:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Namespace-scoped declares, again From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > I plan to pick up this proposal again. I think the motivation here has > become more pressing in the meantime. The strict_operators proposal is > under discussion, and Rowan's "locked classes" essentially concluded with > "doing this with a declare is better". I also think that this proposal will > be helpful for the explicit call-site by-reference passing RFC. I think it's a wrong way to make semantics of the language to be different in different libraries. We add one option, than another, than another, and soon we have 512 variants of the language, all slightly different, and you have to keep track which one you are dealing with on each file, and God forbid you move a piece of code from one library to another, you have to rewrite half of it because it was written in PHP #243 but this library is actually PHP #116. I know there is not a consensus about usage of some newly proposed language features. I think introducing this kind of fragmentation to deal with it is exactly wrong way to deal with it. It leads to code from different codebases being incompatible with each other on source level (even if they work together at runtime). We've decided not to do INI options to change language behavior, and I think we should also not make declare() options to change language behavior, because they are - especially when applying to more than local file - essentially low-grade INI options. They create non-local context that changes behavior of the language, and they make it impossible, reading the local code, to know what it actually means and what would happen if you run it. I think it's much better for the language not to have some features than to fragment the language and make it incompatible with itself. > Based on the received feedback, I plan to change this proposal from being > "namespace-scoped" to being "directory-scoped" instead. This should both I don't think it improves much, in my opinion, and it also introduces hard dependency in the language on specific placing of files and directories - i.e. if you move file on the filesystem, it can actually work differently, which was never the case before. Having concepts like filenames change the core functionality of the language looks to me like an example of leaky abstraction and a hack which may solve a particular problem now but at the cost of making the whole design more messy and introducing more problems in the future. I said before that moving code between libraries in this setup could break it - but with this change, even copying a file to a different directory may break it! Moreover, change in one part of project, changing some behavioral option, would propagate and influence code about which the changer may not even know (e.g. if parts of the project are developed and tested separately and only deployed in final form on a production filesystem). This looks like potential to create an environment that is very hard to navigate and keep straight which of the options is in play for each peace of code. -- Stas Malyshev smalyshev@gmail.com