Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106859 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65481 invoked from network); 4 Sep 2019 19:44:10 -0000 Received: from unknown (HELO mail-qt1-f175.google.com) (209.85.160.175) by pb1.pair.com with SMTP; 4 Sep 2019 19:44:10 -0000 Received: by mail-qt1-f175.google.com with SMTP id l22so13027310qtp.10 for ; Wed, 04 Sep 2019 10:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZoeKPES8hiFlApZulHwm9xQU71gtenCnpLek4tfnFbg=; b=Lqg5m4m1IHG2q3Q5ksOsCUAwOjSnSHB8gJsee2Ryo1oMawqSXBtQiQXrtJ0+diI8WH TycpLlKGxAVtSmMI/1rAPNMNDzRpwMj3dsbG3yufAr7Z3aDSsAmPc19t6IEeV3mmVNw2 8qN+nHtB8tkq3MD7S+/Ks5LTvku+Q26pd+eW3+iptyMvp1cagU4t7UCQ5cX68TCIsi4w kVoNs5afuYwhXotrFs0/MCdTB9T/1qcXDsrrPwUy55mwhqWZcNSw31tL3HpIifofKcCK XHEAPm+g3gylX5dqN0sPBuHEEyaxUAkeQTGGpWWPrTx5obc7mvS0z+K483ZSyHvB7I27 QZjA== 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=ZoeKPES8hiFlApZulHwm9xQU71gtenCnpLek4tfnFbg=; b=q+TEdEy5m/BM8+ALBtzd7D+5pWzSrz96nNRvSmrQia4Ecv4Rz3VbCvcR4vhb3YV1SD LkKkNiWUUvokp1aSSrlcuc4nkoKSD7a065vvRItT51dQ5E6UH6g/khL314+hjcPVApsO D9FiPplRMmOyuZelzr32RmStzTlGH2MX8MEyIAIWSUmG8pmVDgTisWmE82DSHROki/UI +8VohAkHY5Rp+fVnp2HPTcI6wqtSQ10dKQ17eBldq45EnUeNngOPQpP0d27i9FCgVvsv cOGL9I2F5nl7Oxcn05KS0ZRqG79U/gMBiG+9V/5EchMiu9zWb7y+2ZQSd3UZANDprYlY cuug== X-Gm-Message-State: APjAAAXRiP+3TS8E0x76ENpP9FDF83MzkxBMzV9aMuyArLr/ZJ07diSk HVbMy6XlatuWSbYD5MnX/FJwzViiyaY= X-Google-Smtp-Source: APXvYqw2CC8PW5AhF6P8l+/ckiB+sxyxBmQhAwgSq2bDTxn8jx2l5UeJQgaKlkFh2G479mOfXILz9g== X-Received: by 2002:ac8:6955:: with SMTP id n21mr5419197qtr.86.1567617487114; Wed, 04 Sep 2019 10:18:07 -0700 (PDT) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com. [209.85.160.179]) by smtp.googlemail.com with ESMTPSA id t199sm10593618qke.36.2019.09.04.10.18.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2019 10:18:06 -0700 (PDT) Received: by mail-qt1-f179.google.com with SMTP id l22so13027216qtp.10 for ; Wed, 04 Sep 2019 10:18:06 -0700 (PDT) X-Received: by 2002:ac8:4a8f:: with SMTP id l15mr41335896qtq.29.1567617486254; Wed, 04 Sep 2019 10:18:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 4 Sep 2019 19:17:55 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Lynn Cc: =?UTF-8?Q?Micha=C5=82_Brzuchalski?= , Fwentish Aelondes , PHP Internals List Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Silent Types From: andreas@dqxtech.net (Andreas Hennings) On Wed, 4 Sep 2019 at 09:22, Lynn wrote: > > Note that this behavior would require making some decisions whether or not > in the future this opt-in behavior should change when a default value is > given, such as with C# and type inference when declaring a variable, based > on its assigned value. I think this would too easily lead to mistakes. E.g. if in a git commit, "$x = 5.6;" is replaced with "$x = 5;" or "$x = '5.6';", then would a reviewer notice that this implicitly changes the type? Also, what if the initialization is inside an if branch? Later the if/else gets reordered, or one of the conditional branches gets removed, and the variable changes its type?