Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107613 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 12613 invoked from network); 21 Oct 2019 21:25:37 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 21 Oct 2019 21:25:37 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 8299C2CE9F3 for ; Mon, 21 Oct 2019 12:11:20 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 ; Mon, 21 Oct 2019 12:11:20 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id l12so13088431ilq.4 for ; Mon, 21 Oct 2019 12:11:20 -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 :cc; bh=TfeHGoxP644bnkacgjqN3QeD+u2uDmzxcZnfC5jocgE=; b=me+gorDwJCXxwMCY8QokDHdaYn6C9vhc7jbTgTJf2+rQZ9BP5yCuw0jJUdh9WIjRsp xOx8s28uoHGGaDXz1uf86FfU7EZK8JqGHS3oeuvB1OIN/54ZB608q/rkEVyQ1DDpAXFw P8pG30wYtggY4ZmeLpokWS2s8V/WbemWLmtSPEnWyW39GLyxuSlzOatEwnkzxb90jiy7 Yf/hxe6tZfIDeGsC9/kaHcqW0wOZ4hX3K/Pa5wMW5YHU/cQgh/Ul+AW1I59DPwdXs8e7 rZHKBpaimMC6+kdOXt/Naol4KNUwJQoGZL/GtWFtsVKqd4vylJDAoQeAGd3I1KVyEsCI MTOA== 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:cc; bh=TfeHGoxP644bnkacgjqN3QeD+u2uDmzxcZnfC5jocgE=; b=HQFRlQdADRl3m1b2wno2FWDM//Rei7w1Za5fByy0OhzKeHQSrFG+cDJxZTVhNGA+r6 BpTU8uPa8Hkh12cTFx2nKJVx6VXvZfn4Uf/dqmrHeqc7fwz+NyrxAR231EDNWU+MaZ/8 +XuUAfnzBW1MzJ7RjvsA2f1jDsLOyMyFjlKL52lRdLzAtY4s3LNRud7aLNJwKiceZaQI /MkfNRyTYernVnbFWx5uOsMMC4rioeCc8GDMkDQO6etZNURIGmDs8inJTBoelhArZDzF 2v1nundB8fvm2gQh+prtLfKCCCfnc2koHMgDMzR6EQa1REoS7h5S4Fa7j5wh/Q2622l8 qxMQ== X-Gm-Message-State: APjAAAWVOB4AJu5mk0yQ+QRPoW5ZySkgeG1pDZOfhpyxJTUP8U/jD3jZ DtLaW94zzkNti3LEUlRRhVWnloyHTJIp0f4KoFI= X-Google-Smtp-Source: APXvYqz3+kQA/qH0+TgZU349P2q2AFopkf6lTxJELO64fwL07D/7hXjDgRNfUSvP5dTISG/c/zm+wiaDS7u1S0LRVgE= X-Received: by 2002:a92:60a:: with SMTP id x10mr13680962ilg.185.1571685079279; Mon, 21 Oct 2019 12:11:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 21 Oct 2019 15:11:07 -0400 Message-ID: To: Nikita Popov Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000d96f9005957072b7" X-Envelope-From: Subject: Re: [PHP-DEV] substr with null length From: colinodell@gmail.com ("Colin O'Dell") --000000000000d96f9005957072b7 Content-Type: text/plain; charset="UTF-8" On Mon, Oct 21, 2019 at 11:29 AM Nikita Popov wrote: > This is a fairly common deficiency in the implementation of internal > functions. Part of the reason is that historically zend_parse_parameters > did not support the ! modifier for integers, and partly these are just > implementation oversights. > > Feel free to send a PR to fix this for PHP 8, no RFC needed. If you're > interested in addressing this for more functions, do a grep for "= UNKNOWN" > on the codebase, which gives you (with a few exceptions) a list of > functions that currently handle null parameters incorrectly and should > ideally be fixed for PHP 8. > > Thank you so much for that guidance! I wasn't sure about the RFC as it's technically a behavioral change, but I agree with you (and Christoph) and have therefore submitted a pull request with this change: https://github.com/php/php-src/pull/4840 I'll also take a look at those other functions and see if I can assist with adjusting those other instances as well. Cheers, Colin O'Dell colinodell@gmail.com --000000000000d96f9005957072b7--