Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105181 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83298 invoked from network); 9 Apr 2019 19:08:44 -0000 Received: from unknown (HELO mail-wm1-f66.google.com) (209.85.128.66) by pb1.pair.com with SMTP; 9 Apr 2019 19:08:44 -0000 Received: by mail-wm1-f66.google.com with SMTP id q16so4237019wmj.3 for ; Tue, 09 Apr 2019 09:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=h86/PhlSMA36qhY1REtty7D6gzigNRslTaxJ0ioGqAs=; b=eS3ZrpLWyzZeEPwmOZp03Zsb78+5Z3/Lvh+Fq76P4GjsfT/KVZwbfpwTGLAHD0vybJ uIWRKMcK+vCmDEOQvn4UaKeubGl1mr776L6WJHSyoPeexDsG+U/2tnGOz7adI98WqE9o UNIHNLz9ZQa3oWzPpf7z9OvlDJHE8eAjVMlhjMhgt2qVEKF8CB+OsQnaNVJyNgAGrHWS CdQRFhtPycrFtd9iQQjx+RVXwUV6NXZuzdo3ebXI/ET7f/OvCvA2qnzgh/FyUaKfqqXG 5SaWYsnp0/gTZwU8ojzIFFjwo8Vszl2g2E/4B7mUxMTUqH2TUS7g3jlXvu3PBQ5feOw1 FgIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=h86/PhlSMA36qhY1REtty7D6gzigNRslTaxJ0ioGqAs=; b=ZC4T2/JrVtWPPv5Mnki/QTZjEzQ3I7o0tMYtY078nZmSVeIEep6Sm/EyRakGU4tmAs spNfqF8JETbkMCY6B0oowTOxOExXiF5AKMXGNvK+ZmDkd8ScFcSc7EcGtukOk0gXlhu4 7thFpDCofpSy9T61bTpzTkuAsaoukCOLABKU35pkwCyJWN0TY0XsvaTMnyT+IWDwg7j9 DaKsghM5gaj1k38R//EOnwFlLfK3217UX4VlOi4bvcmsOKtoonFtJ4oDGhjbZOc2PgVN tSntyljT0IQRjgMVBVJhEDJ/s4jBQtD4jhrC3y6cuVv/KhzFjWh3m0DYacwW+ZPx36Bj qyuw== X-Gm-Message-State: APjAAAXCszAvLlDHlfIi9oy8xh2mD8yU9JPNntpLJmIljaGTllOxsPGk YJxWaiU/9intcrMCPu8e9Nw= X-Google-Smtp-Source: APXvYqwqU5IVoCoe+6iN7Adw9VTFQtgDJNK/N2DCpzqu5vFIYHu5UEwANt1aEuz5lrsRAnEaCl3mag== X-Received: by 2002:a1c:6c09:: with SMTP id h9mr2681323wmc.130.1554825938854; Tue, 09 Apr 2019 09:05:38 -0700 (PDT) Received: from 2a02-ab04-01c2-6000-c047-ab93-1113-1f51.dynamic.v6.chello.sk (2a02-ab04-01c2-6000-c047-ab93-1113-1f51.dynamic.v6.chello.sk. [2a02:ab04:1c2:6000:c047:ab93:1113:1f51]) by smtp.gmail.com with ESMTPSA id a17sm12613181wmg.40.2019.04.09.09.05.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 09:05:38 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) In-Reply-To: Date: Tue, 9 Apr 2019 18:05:36 +0200 Cc: Dan Ackroyd , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <3BCEA463-BD9B-468B-AF26-E0AD75C5F559@gmail.com> <16a029d2430.27c1.08be835b7d1a2c2edb4c4286afe1a236@gmail.com> To: Levi Morrison X-Mailer: Apple Mail (2.3445.104.8) Subject: Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures From: gadelat@gmail.com (Gabriel O) > If you want the reverse to be true, then your code has bugs waiting to > show themselves I don=E2=80=99t, I just don=E2=80=99t want fatal errors in production = when I upgrade library I extend. Let me keep logging such issues and fix = them later, instead of producing hard crash for customers. > The earlier we can catch these bugs, the better. What prevents somebody to catch warnings? This RFC is about hard crash = that I disagree with. This type of issue is problematic only when = expecting parent but injecting child. > On 9. Apr 2019, at 17:35, Levi Morrison wrote: >=20 > On Tue, Apr 9, 2019 at 9:00 AM Gabriel O wrote: >>=20 >> I believe rfc deals with reverse situation >>=20 >> On 9 April 2019 4:47:50 PM Dan Ackroyd = wrote: >>=20 >>> On Tue, 9 Apr 2019 at 11:58, Gabriel O wrote: >>>=20 >>>> And this RFC conveniently shows only big LSP violation examples = like array >>>> -> int, but not widely used narrowing like mixed/object -> specific = instance. >>>=20 >>>=20 >>> Type narrowing or contravariant parameters is properly supported for >>> PHP 7.4: >>> = https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters >>> , which is why this RFC doesn't need to cover them. >>>=20 >>> cheers >>> Dan >>> Ack >=20 > If you want the reverse to be true, then your code has bugs waiting to > show themselves. The earlier we can catch these bugs, the better. >=20 > One thing to note is that return type information does permit > optimizations in some cases. For instance, I believe if a private > method has a return type constraint of int, then the optimizer can > rule out certain edge cases, and in some cases use type specialized > handlers. We can do these sorts of optimizations in more places if the > LSP issues are always errors, instead of warnings. >=20 > So for both correctness and performance, I support this change.