Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105852 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14471 invoked from network); 6 Jun 2019 15:34:57 -0000 Received: from unknown (HELO mail-io1-f45.google.com) (209.85.166.45) by pb1.pair.com with SMTP; 6 Jun 2019 15:34:57 -0000 Received: by mail-io1-f45.google.com with SMTP id e3so36531ioc.12 for ; Thu, 06 Jun 2019 05:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=rjuKY1pVoxs5EbHWNCFZxCGtAPvHmCjlxsYkaczEwZI=; b=bnyuDA5DFmnas/8a2wHcva19+QtbtW/O14a4VZ1rxmkkrN8jJsKf5FPRRxOwV5QsYS lNtQeYy+jNL7eR+eHUjYngPvCyQVipGksKvMYIXMBGfdCeBKNuA+MIbLdJs/AmlSTodK jVLH3GPuFMsCV0K5+Z7NmbJtCdadCUArBa4bn6v9S+v/DIEyCgC0El7pWf0B+dxQd6xt +6TT8oyjVoPA0jAoyhuN59vFmgnjyhYvN63ntMVFQW+8P8W2QpmKMmQhc4ybn4kV4y+W 0usegDRx242aYkbg8x98Tdbm4qEbVjGCyMfeQeUuWvmBr093ygM4jp/zmI7B7IYGDiwA wfqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=rjuKY1pVoxs5EbHWNCFZxCGtAPvHmCjlxsYkaczEwZI=; b=TRe43mAur0QDASSOD1JPuk5t5yidysTjXOFwFDcXrhkMw1DYwDYCzjy0GgBU7Fd/AJ xMkOe0cgM7Cfe0pnXCDsIer5kU7wEBKkOx2QRaDSE9hdsJEViUFSnPQmKbhzDz2f81nX TNhwmKNuOW07tLhs3HwPwWtHWP5Tuxmw8035FWiwLLN1VvNzXK4S4lyRM3OJk2jvnL0V xHnRZBUbRwxv9AcxyWED2lRX+BJyy7357S4vs5GqFrgf0gxmO6MJjwsAW5cYUvd4WL67 PWsrNf6H9KpIOoe5UvBJB8WPPEJKN0KKNEAMzDszUKkNLkK8dcmxP2RM4fwwA/6NiAKm iqEQ== X-Gm-Message-State: APjAAAXf6MPbbPjtD/qfpxKJRP2/JO54XsYHywQJouRG8MKMPs/ZVNZD EJiVtGmORiuIKfbTp4wuPyfKmhPQd7CmzTPYhq0zrhzS X-Google-Smtp-Source: APXvYqzEEaykXMvHh+r6+Sql/0IShydclAUbGwGYF+CRqlCKZoeDAx2VP8E74RrLMPl7SDki2KDyf6Cq6GehHEiAYlo= X-Received: by 2002:a6b:7:: with SMTP id 7mr25284573ioa.253.1559825180768; Thu, 06 Jun 2019 05:46:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 6 Jun 2019 13:46:09 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000cfc79e058aa71945" Subject: Re: [PHP-DEV] Handling of null arguments to internal functions From: rowan.collins@gmail.com (Rowan Collins) --000000000000cfc79e058aa71945 Content-Type: text/plain; charset="UTF-8" On Thu, 6 Jun 2019 at 12:49, Arvids Godjuks wrote: > consistency, in general, would be a nice change of pace so you don't have > to keep in mind that there are slight differences in behaviour depending on > what you call - a built-in function or a userland one. > This is my view as well. Another thing that inconsistency causes problems with is polyfills - if you want to wrap, emulate, or otherwise reimplement an internal function, it can be fiddly to emulate the subtleties of ZPP. (This gets worse with objects, which can do all sorts of wacky things internally that have no user-space equivalent, but that's a topic for another day.) Would it be possible to use a combination of automation (analysis of the C code, or fuzz testing of the functions) and collaboration (a great big list people can work through a section of and report back) to categorise the functions in core? Something like: a) not affected, because handling is consistent with userland anyway b) should explicitly accept nulls c) should explicitly reject nulls We do however have to make a tricky judgement on functions in category c, of how much code is going to break if we make them stricter. Regards, -- Rowan Collins [IMSoP] --000000000000cfc79e058aa71945--