Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101833 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10331 invoked from network); 12 Feb 2018 05:51:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2018 05:51:22 -0000 Authentication-Results: pb1.pair.com header.from=pslacerda@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pslacerda@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.180 as permitted sender) X-PHP-List-Original-Sender: pslacerda@gmail.com X-Host-Fingerprint: 74.125.82.180 mail-ot0-f180.google.com Received: from [74.125.82.180] ([74.125.82.180:34771] helo=mail-ot0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/79-18020-85B218A5 for ; Mon, 12 Feb 2018 00:51:21 -0500 Received: by mail-ot0-f180.google.com with SMTP id l10so12965579oth.1 for ; Sun, 11 Feb 2018 21:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=1J0KKTAsDdRts/mUNz+PklirTfiVVEEcDoxTDIwCZsI=; b=XA30n1JgHCkHOsaghiOjCwapHCTvxqMwK0sdhDdAqsjTeEqNNUJLOUmmIM3Fkxe3Q/ thJOfUbh2NmCVn4w1vwOmMBdg5yOZYhydJIurGV6n+Kkv6gYpJ1R2Mj4mfNtaHYg2g3h UZdKhPjn+aTVZVXlhYn2kep9mLu3d80wrGd0zA6gkCOCD85gwi2w/UjrMqtcgbFvtUVD fGJnXqZxNHjqpscyWFngDv/en6Y2/YdwjA4p1kNXOA2JZH+y63sWCwuqwSQK2DOfxmxw 8CKsCizyhOYf7BW8zlBYBPH/Cd9O73H+RIdyx8wjLE3Zn2FVDk4+kGeNHpJDgvCWHIMI u7yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=1J0KKTAsDdRts/mUNz+PklirTfiVVEEcDoxTDIwCZsI=; b=d18BDT9bNWbjkKUqpPKmccY6aTnoZfdQyZlNxt1/bFVYBdW/Wm+BA+nmUuWyIrHRu4 5hfdsZagoRo0LyFTV2IMrAhXOyHZf2CUxqO673Qvd2LSqTgtbvfH/Sl1shsiHZiFrK64 IowFOSCExXasbCkjZP2mpoywK0DEc2RYss4reiXO8VkGtVraTvcYVJcG9CcrOmzysCLe dyumUp92MHVDmI140GMNxnVEPsrbsTe/vNuU8dId9kvyTEwgm051+3TywPHb4+9hO42A Z+Y8eIeiffG2FeFEYI60DH6mZ4nQQPcf+fzn069d0PZr2KuXwQ4WnrZRo0L04Mgi6g2H kk9Q== X-Gm-Message-State: APf1xPBqAiprlrZHKjr6y7y6vZQGKPNU67JOCil5hE0I5ix10yr/zZXn zcLwDTpWkLiDcWDXVG7mZZ9EoMq1VJk+JKhTn05elw== X-Google-Smtp-Source: AH8x227j7KKsWYQhcSDcYnlDbpSy1T03i8rX7g5SufUcGQ/hHrTUkW8n8LjiLYED4uf5w8jGNYL97VUQl9/YAtxPJLw= X-Received: by 10.157.26.60 with SMTP id a57mr8354287ote.166.1518414676860; Sun, 11 Feb 2018 21:51:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.7.195 with HTTP; Sun, 11 Feb 2018 21:50:56 -0800 (PST) In-Reply-To: <5b21571e-722f-43e4-5c9c-4def39447e1e@gmail.com> References: <5b21571e-722f-43e4-5c9c-4def39447e1e@gmail.com> Date: Mon, 12 Feb 2018 02:50:56 -0300 Message-ID: Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="001a113e27f46fa3960564fd77f1" Subject: Re: [PHP-DEV] Proposal to run all tests with and without strict_types enabled From: pslacerda@gmail.com (Pedro Lacerda) --001a113e27f46fa3960564fd77f1 Content-Type: text/plain; charset="UTF-8" > > 2018-02-11 20:34 GMT-03:00 Christoph M. Becker : >> >>> Umm, I wonder whether a magic constant (say, `__STRICT_TYPES__`) would >>> be more appropriate. >> >> Implement `__STRICT_TYPES__` was a breeze, very hackable codebase. A magic constant indeed sounds more appropriate. Hi Stanislav, 2018-02-12 2:18 GMT-03:00 Stanislav Malyshev : > I am not sure what would be the advantage of this. Beyond testing > strict_types functionality itself (which of course should have its own > unit tests), the tests that test standard functioning of any function > would either supply correct arguments and then strict_types would be > irrelevant (provided it works as supposed to, which is tested by its own > tests) or provide incorrect arguments, and then strict_type tests should > be different from regular ones since the errors would be different, so > we'd have to write separate tests. > So it's a lot less useful than what I thought. > The only class of errors that could be found this way would be if we > somehow made such a mistake in defining the arguments of certain > function that strict_type version of it doesn't work but regular version > works fine. Which I guess is possible but does it worth the effort to > convert all tests? Not sure. > But it's still useful, I just fixed a bug exactly about it. Given that there is very few tests that use strict_types, to "convert" all tests with `run-test -t` is not too hard. Anyway all tests other than for incorrect arguments should run correctly with `-t`, so it may be a default for testing. The problem than is to know wich tests mus be runned without it. https://github.com/php/php-src/commit/fddd7e38bd01bc6dbc473166dd6f92 e9f81a6eab Besides testing, may or may not be valuable expose a `__STRICT_TYPES__` constant. https://github.com/php/php-src/compare/master... pslacerda:experimental/strict_testing?diff=split -- Atenciosamente, Pedro Lacerda --001a113e27f46fa3960564fd77f1--