Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107020 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73818 invoked from network); 12 Sep 2019 23:23:48 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 23:23:48 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id CEE922C0478 for ; Thu, 12 Sep 2019 13:59:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 12 Sep 2019 13:59:46 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 7so432474wme.1 for ; Thu, 12 Sep 2019 13:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=J1+gS0mlOnkAAEWEVUd0XIbCQ9OpJKX3uSc/0VuEMJw=; b=TW5AGulh6xsQCfZ/SA6cA138aHtGNUIgM3x7yNX7ZEogYdks6QIIUaR1/lEqUcxbJd 2mOxpJhwVyjjULTtCUQ5ga1io5ai//JdVPHMeLKFlMc9AM6LEdUvbbZ3+ytkRFBPVfHS LSai1IizMS/J2c6O5pXQTChx6thbHg1SzbfRPam4lPmV8N8DkIsCzSdN1CqSClSkckmi /F1JO+KnLDOAjKycmL78ydOciRyBXsn1ktzoMhU8q8OnhjQ+tbHstMJyXhur9qg8AJsE CTGCO0Pd9FkmFDxJX+6r1BACO5Hf3QmOOzCIgkuyjdBIMHsK1kCi7q3pgeb4Jv4sYRS6 wynQ== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=J1+gS0mlOnkAAEWEVUd0XIbCQ9OpJKX3uSc/0VuEMJw=; b=ahcXo/ErGnRckit1CMNm5E/4my6wXyQfNlYadiYoaLO5Fvd9jrfmSspxtTZCIxGz1k g7Cqzh/vznqcciBT1zJ3roXOQ3yxVsv1IZpA9nh0kr8b9EI2EJG7F3k+sLTySXubgStD dYwzXuufJ+/50NSPnzSTZwCcOF1gIxoGLN5EWYgDJXoDKaTSNEbvgT5v6bHOEVLhu2Dl PHraveRJo4/FrXwfQSrfyhkPM5PmF9ZhrpB12aomlVK7vkEKzoR3kxcf8ufOH62tAc2v SlIXqKXOVyHInMSEgbUWsEKynvhM9XvT6kiK0dz+f805hrHc7SKon0G4c34l60P93rcj O9nQ== X-Gm-Message-State: APjAAAUDJ/s5FktGU5pdhjqtxQJeF+dNR2OG7/pJ5z3so6VsQ0QN3ktt krYYW2n6oYtd6QM3ZvaD/10RNiky X-Google-Smtp-Source: APXvYqzzgQuJz+3zo+dRtysX5oJYyJJegxRBLphL+uefbSWp26gXzvBbrh7y5A3HECSof2r8XJAmUw== X-Received: by 2002:a05:600c:cf:: with SMTP id u15mr455082wmm.168.1568321984814; Thu, 12 Sep 2019 13:59:44 -0700 (PDT) Received: from [192.168.0.16] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id a192sm625367wma.1.2019.09.12.13.59.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Sep 2019 13:59:44 -0700 (PDT) To: PHP internals References: Message-ID: Date: Thu, 12 Sep 2019 21:59:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: rowan.collins@gmail.com (Rowan Tommins) On 12/09/2019 15:13, Nikita Popov wrote: > FTR this is basically what Python does via defaultdict: > https://docs.python.org/3/library/collections.html#collections.defaultdict Thanks, I'm glad I wasn't completely daft thinking there might be some way to express it. :) > I think it is the "cleanest" solution to this problem overall. Though > it does need a separate structure, rather than our favorite PHP array. Indeed it does, and I think that's the better route to making PHP a stricter language: before we take away the existing features, add the new ones that let you express things better. PHP's array type, and its type system in general, allow a lot of very expressive algorithms which are hard to do with more rigid type systems. Modern languages like C# bring back that expressiveness using things like generics, a rich library of built-in collections and interfaces, and so on; they don't just say "sorry, you can't do that". Regards, -- Rowan Tommins (né Collins) [IMSoP]