Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105626 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16087 invoked from network); 7 May 2019 17:18:24 -0000 Received: from unknown (HELO mail-it1-f172.google.com) (209.85.166.172) by pb1.pair.com with SMTP; 7 May 2019 17:18:24 -0000 Received: by mail-it1-f172.google.com with SMTP id l10so26704326iti.3 for ; Tue, 07 May 2019 07:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=T9IDYD5+HJtVolqJeZPtn1grs2setWazj7Xikjx4s+U=; b=B11/zs9kE1RsBxrZeEKo+eEnn6hAG0c4X2iA1gkT+3aMJnBixZ45is48TOwc5WrxFu IPMN3CQHkWXJlvKIzqvjIAhMVT6VJMVW5sCUqQ/TiN3fg6NDZc/022OSK0sKSv2Umwq5 QmPL8G1U7+0lVFp0qpuWnAKa/A1/X5hBkZMtSKahmzeI8vqYqEua2eSUHEbziJHQ3A+Q tqbcyWbhxRXaxlxOg/t8kCPTDAMvU0h+DeukYF+pK0Fj/Ber9LBKeGXN1wxtDr3AjUIR SVseAMdxzjpXjYP+0OQpZ7bJOR/yL7eK42iws5fdNrIFODsljsXEbR3GJIiC7twXseO8 FIPg== 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=T9IDYD5+HJtVolqJeZPtn1grs2setWazj7Xikjx4s+U=; b=Qf2rX32bwj/17upKLIm0mZgnczIEbjuhrrwkFra70IdTQF1DZ/3pejrXMvnPy5fswL kgNABi4Oy2OF7KdmXgyREWY5lr9O5KjFOG9AhY7ygwqSWbB0Up2WRXRCyV9iJc5++NGQ SC618HC0AsLg2ntJO36lwpLKzRq6dGh9nL9w9rbtou92PiTqNNoY6D3lnTbfLWE5IQgt 5mtzkGvK4grqrYJ1+BFZbxoS6GeSfvJF+VZGpsArARUHV2jPDiDAJZUDBGov2fmjSwZl mXun22hc1Zffe6mL7DdtxvmXrp1+6qd8bLJ+jGeB4OhHuQPXFdO5BFNf4tLtVv9aY0MU Z2lQ== X-Gm-Message-State: APjAAAUPbQrYPqGO3JrGl5DyDx63P5LidT9S69KJMO8lS3jvJe3Xo7jg 9Lw/NQ6xxn/08CmFrQZ2yofrshS3+qz8W+9/zZu3gHIprjyGRQ== X-Google-Smtp-Source: APXvYqwk10kxmjT0NHLhjWaxMo9kxkxwzcb5gbjuR/LOWw2YlssiA+605sFmNu+HzJYJ6emySwkQEor0M8afCaX9NQc= X-Received: by 2002:a24:4523:: with SMTP id y35mr21984358ita.153.1557238938327; Tue, 07 May 2019 07:22:18 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 7 May 2019 16:22:07 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Error instead of returning false From: gertp93@gmail.com (Gert) Hello internals, I wanted to propose an RFC, but i'd like to check first if this idea has been considered before already. My idea, extremely summarized, would be to take the functions that return false/null when they 'error', and instead make them actually throw an error. Currently, functions like getcwd or json_decode will return false/null when an error occurs, and they populate a global error state, which can be retrieved by error_get_last, or similar functions. json_decode already got the JSON_THROW_ON_ERROR option in PHP 7.3, and this RFC would basically make that behaviour default. This RFC would target PHP 8.0, but i'd like to hear some opinions on this. Greetings, Gert de Pagter (BackEndTea)