Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109315 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38697 invoked from network); 26 Mar 2020 01:46:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Mar 2020 01:46:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 659DC1804E0 for ; Wed, 25 Mar 2020 17:11:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 25 Mar 2020 17:11:13 -0700 (PDT) Received: by mail-io1-f46.google.com with SMTP id d15so4292918iog.3 for ; Wed, 25 Mar 2020 17:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=iDDcYT5GiWU/RSc+JeEZwB7oBQgkKERxgozd0iSjLh4=; b=SU5vb3M0Laa5CVobHeCdn7IhmRUGh3x9zXuxhKsWOpMOOKHJIxsrYKjfhJllfi4Hvh p64qOXIu0pjDV1t7DXQzLz9xWlCN/RIJxsvZ77VxlM+IGbppUGNqnF2Ry1erWypaT9Rm PPK4m01b58fq2wECdA+ax5zuVXGhN4osxNjVQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iDDcYT5GiWU/RSc+JeEZwB7oBQgkKERxgozd0iSjLh4=; b=hsbTtwDcXoxotMbTYQnG2ex9BdmnwpKF+oJm78nTwGlRVqFbuBKmxzWn0eEqEhjClA RQjrF4SB1s4dxXx6ohLbF+qoLVehUsuOPYlucfypW5G2wb9zEBvB3RFC/47iKJI9Zubu PqfQXTNolBTSUrAWtRd0bWDn16vkQiWrdgGGAPL6f35qtDDSXWrBca3y/NiVs7Lc14NT OJICxLziUF3WwZk+8H8+hnRd+OX5nQ3+bQ9v8Ew1WzygXwOvt30wIVXX5cuYq3wjeOwT 5taEA2OSInD+0DdnpVWFJp5kgQNK6vk3JB7zecADYBmb1BqcSGBPxbe937M7C/p3+qZN xcWg== X-Gm-Message-State: ANhLgQ2g/8QejmBMk9LkLjd6z/R0DEEql5GDIyY1A+oX62K3ZKXsSUns +g4xbS8m/flEdZrYJllNWO/zZx1HlB/ClNvEKy1V+96IqoQ= X-Google-Smtp-Source: ADFU+vtL5pWLs4wTOqn6F0gTHbdXSQRn2cgOjfwvtiqNpjo7JytdUXAhlRXT7AU2j8EfT2l4U0zjdWUfx9dFHNLqWUA= X-Received: by 2002:a6b:6d16:: with SMTP id a22mr5404701iod.182.1585181472670; Wed, 25 Mar 2020 17:11:12 -0700 (PDT) MIME-Version: 1.0 Reply-To: Levi Morrison Date: Wed, 25 Mar 2020 18:11:02 -0600 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Removing warning for failed include From: internals@lists.php.net ("Levi Morrison via internals") It's bothered me for quite some time that a failed include emits a warning. This is because it's by design that the author chose `include` and not `require`. It's _expected_ that it may fail and they are okay with that. As an example, consider a classic autoloading case. It could be as simple and performant as: $file = /* something derived from class name */; include $file; But because of the warning, in practice authors tend to use `file_exists` + require instead: $file = /* something derived from class name */; if (file_exists($file)) { require $file; } Weird isn't it? Authors are using require instead of include for the case where failure is tolerated. This is a clear signal to me that include isn't doing its job. The warning gets in the way. Any reasons we shouldn't just remove this warning for PHP 8?